File Button
Allows you to select files with a single click.
import { FileButton } from '@brainandbones/skeleton';
Monitor your browser's console when adding files.
Usage
Note that class values are applied directly to the button element. Use this to provide button utility classes.
let files: FileList;
<FileButton bind:files={myFiles} class="btn-filled-accent">Upload File</FileButton>
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. |
Events
Event | Description |
---|---|
on:change | Detect when then file input value has changed. |
Slots
Name | Description |
---|---|
Default | This slot provides the label for the file button. |