File Dropzone

Allow upload of files with drag and drop.

javascript
import { FileDropzone } from '@brainandbones/skeleton';

Examples

Monitor your browser's console when adding files.

Drop files or click to select.
Drop files or click to select.
Files should not exceed 5mb.

Custom message example.

Usage

ts
let files: FileList;
html
<FileDropzone bind:files />

Notes Text

Use the notes property to provide addition information on a second line.

html
<FileDropzone notes="Files should not exceed 5mb." />

Message Slot

Use the default slot to replace the message entirely.

html
<FileDropzone>(message)</FileDropzone>

Properties

Prop Type Default Description
filesarray-Bind this to your form data, represents the "files" data from the input.
acceptstring-Set the native file accepts attribute.
namestring-Set the native input name value.
multiplebooleanfalseDetermines whether user can pick more than one file.
notesstring-Provided additional notes or information.
Prop Type Default Description
widthstringw-fullProvide styles to set the dropzone width.
heightstringh-24Provide styles to set the dropzone height.
paddingstringp-4Provide styles to set the dropzone padding.
colorstring-Provide styles to set the dropzone text color.

Slots

Name Description
defaultReplace the message with custom UI.

Accessibility

Uses input[type='file'] to allow for all native input accessibility.