logo-icon
STW UI

FilePicker

FilePicker is a an input field for uploading files.

Usage

svelte
import { FilePicker } from 'stwui';
// OR
import FilePicker from 'stwui/file-picker'; // for tree shaking

Basic

Complete Example

Multiple Uploads

Disabled

With FilePreview


FilePicker Props

name string nanoid()
onDrop function(files: DropResult)
onEnter function | null null
onLeave function | null null
accept string | undefined undefined
allowedExtensions string[] | undefined undefined
maxFileSize number | undefined undefined
multiple boolean false
strict boolean false
border boolean true

FilePicker Slots

icon <FilePicker.Icon slot="icon" />
title <FilePicker.Title slot="title" />
description <FilePicker.Description slot="description" />
divider <FilePicker.Divider slot="divider" />
action <FilePicker.Action slot="action" />

FilePicker.Icon Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

FilePicker.Title Slots

default

FilePicker.Description Slots

default

FilePicker.Divider Slots

label <FilePicker.Divider.Label slot="label"/>
default

FilePicker.Divider Props

position 'left' | 'center' | 'right' center

FilePicker.Divider.Label Slots

default

FilePicker.Action Slots

default

FilePicker Class Identifiers

stwui-file-picker
stwui-file-picker-input
stwui-file-picker-label
stwui-file-picker-title
stwui-file-picker-description
stwui-file-picker-icon
stwui-file-picker-divider
stwui-file-picker-action