File Button

Allows you to select files with a single click.

javascript
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.

ts
let files: FileList;
html
<FileButton bind:files={myFiles} class="btn-filled-accent">Upload File</FileButton>

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.

Events

Event Description
on:changeDetect when then file input value has changed.

Slots

Name Description
DefaultThis slot provides the label for the file button.