File Dropzone
Allow upload of files with drag and drop.
import { FileDropzone } from '@brainandbones/skeleton';
Examples
Monitor your browser's console when adding files.
Usage
let files: FileList;
<FileDropzone bind:files />
Notes Text
Use the notes
property to provide addition information on a second line.
<FileDropzone notes="Files should not exceed 5mb." />
Message Slot
Use the default slot to replace the message entirely.
<FileDropzone>(message)</FileDropzone>
Properties
Prop | Type | Default | Description |
---|---|---|---|
files | array | - | Bind this to your form data, represents the "files" data from the input. |
accept | string | - | Set the native file accepts attribute. |
name | string | - | Set the native input name value. |
multiple | boolean | false | Determines whether user can pick more than one file. |
notes | string | - | Provided additional notes or information. |
Prop | Type | Default | Description |
---|---|---|---|
width | string | w-full | Provide styles to set the dropzone width. |
height | string | h-24 | Provide styles to set the dropzone height. |
padding | string | p-4 | Provide styles to set the dropzone padding. |
color | string | - | Provide styles to set the dropzone text color. |
Slots
Name | Description |
---|---|
default | Replace the message with custom UI. |
Accessibility
Uses input[type='file']
to allow for all native input accessibility.