Skip to content

Latest commit

 

History

History
 
 

svelte-uploader

Uploadcare logo

WebsiteQuick StartDocsBlogDiscordTwitter

Svelte file uploading example

Edit svelte-uploader

This is an example project of implementing a file uploader in a Svelte application with Uploadcare File Uploader.

Run this demo locally

# clone this repo and go to the cloned folder

$ cd examples/svelte-uploader

$ npm install
# or `yarn install`, if you wish

$ npm run start
# or `yarn start`

Installation

All you need to do is to install @uploadcare/file-uploader from npm via your favorite Node package manager.

The package provides TypeScript types, so you do not need to install @types/anything if you need a proper typing.

Read more about installation in the Uploadcare documentation.

Configuration

Please, read the File Uploader documentation.

Integration notes

File Uploader is native to the Web, which makes them native to Svelte too.

E.g. in this example we created a FileUploader component which provides Svelte-friendly API for the rest of the view. There is a File Uploader inside this component and nowhere else.

Styling

If your styling solution may provide class string or style object, feel free to use them on components like uc-file-uploader-regular and override default class using CSS variables.

Otherwise you may go “full override” way and pass a string with styles to a File Uploader type of your choice.

Read more about styling in the File Uploader docs.

Contribution

You’re always welcome to contribute:

  • Create issues every time you feel something is missing or goes wrong.
  • Provide your feedback or drop us a support request at [email protected].
  • Ask questions on Stack Overflow with "uploadcare" tag if others can have these questions as well.
  • Star this repo if you like it ⭐️