vael-ui v0.3.10

Forms & Inputs

FileUpload

A drop zone and file list for picking files, with validation and progress.

Install

import { FileUpload } from 'vael-ui'

Playground

Drop files here

import { FileUpload } from 'vael-ui'

<FileUpload accept="" capture multiple :maxSize="0" :maxFiles="0" :disabled="false" name="" motionCss>FileUpload</FileUpload>

Props

NameTypeDefaultDescription
acceptstring | undefinedNative `accept` syntax: `.pdf`, `image/png`, `image/*`, comma-separated.
captureboolean | "user" | "environment" | undefinedundefinedNative `capture` — opens the device camera directly instead of the file picker on mobile. `'environment'`/`'user'` pick a facing side; `true` leaves it to the browser.
multipleboolean | undefinedtrue
maxSizenumber | undefined
maxFilesnumber | undefined
disabledboolean | undefinedfalse
namestring | undefined
motionCssboolean | undefinedtrueGates the built-in file-row enter/exit transition. `false` skips it entirely — reach for `@item-enter`/`@item-leave` instead if you want a consumer-owned animation (GSAP, motion-v) in its place.
uiPartial<{ root: UiPartValue; dropzone: UiPartValue; browse: UiPartValue; list: UiPartValue; item: UiPartValue; remove: UiPartValue; }> | undefined
filesFile[] | undefined[]

Slots

NameTypeDescription
default{ isDragOver: boolean; browse: () => void; }Replaces the dropzone's inner content; the library keeps the dropzone element + drag wiring.
item{ file: File; remove: () => void; index: number; }Replaces one file row's content; the library keeps the `<li>`.

Events

NameTypeDescription
remove[file: File]
update:files[value: File[]]
reject[{ file: File; reason: FileRejectReason; }]
add[files: File[]]
item-enter[el: Element, done: () => void]
item-leave[el: Element, done: () => void]

Exposed

NameTypeDescription
elHTMLElement | null
dropzoneElHTMLElement | null
inputElHTMLInputElement | null
listElHTMLElement | null
browse() => void