Skip to content
Component

File Upload

Button-triggered file input and its drag-and-drop sibling, Dropzone. Both keep a removable file list once files are selected.

Button-triggered

Dropzone

Drag-and-drop target with a click-to-browse fallback.

Drag and drop files here, or click to browse

  • Dropzone falls back to a native file picker on click for keyboard and touch users

Dropzone label

label is the drop target's accessible name; description is the prose shown inside it.

PNG or JPG, up to 5 MB

  • label defaults to "Upload files" - give each Dropzone its own when a page has more than one
  • The file list is a named live region, so a completed drop is announced

When to use

  • FileUpload: a compact, button-triggered picker inside a form (profile photo, attachment, document).
  • Dropzone: a larger, drag-and-drop-first target where the upload is the primary action on the page or panel.

When not to use

  • Very large file counts or resumable/chunked uploads - both components handle file selection and a local list, not upload transport; wire your own upload logic to onChange.

Keyboard

KeyAction
Enter / SpaceOpens the native file picker from the trigger button or Dropzone.
TabMoves to each file's remove button once files are selected.

Mobile behavior

  • Drag-and-drop has no equivalent on touch, so Dropzone always renders a real, tappable file input underneath - touch users tap to open the native file picker instead of dragging.
  • FileUpload is a standard button + native input on every viewport.

Accessibility notes

  • Both wrap a real <input type="file"> under the hood, so they inherit native file-picker accessibility (OS dialog, screen reader file-count announcements) rather than reimplementing it.
  • Each selected file's remove control has an accessible name identifying that specific file.
  • Dropzone is named by its label ("Upload files" unless set), never by its description prose, and its file list is a named live region.

Common mistakes

  • Relying on drag-and-drop as the only way to add a file - Dropzone's click-to-browse fallback exists specifically so keyboard and touch users aren't blocked; don't hide or disable it.
  • Not validating accept/file size server-side - the accept attribute is a UI hint only, not a security boundary.

Known limitations

  • No built-in upload progress, chunking, or retry - these are local file-selection components, not an upload client.

Related components

FileUpload / Dropzone props

value / onChangeNone
File[] / (files: File[]) => void

Controlled selected files.

defaultValueNone
File[]

Uncontrolled initial files.

acceptNone
string

Native accept attribute, e.g. "image/*".

multiplefalse
boolean

Allows selecting more than one file.

disabledfalse
boolean

Disables the trigger/drop target.

CriterionStatusNote
Keyboard supportSupportedEnter/Space opens the native picker; Tab reaches each file's remove control.
Focus managementNot applicableNo modal/portal surface - just a native input and a local list.
Screen reader labelsSupportedNative file input semantics plus a labeled remove control per file.
Reduced motionSupportedNo motion beyond the shared Fuji UI transition tokens, which zero under prefers-reduced-motion.
Reduced transparencyNot applicableUses opaque surfaces in every theme.
Mobile touch behaviorSupportedDropzone always exposes a tappable native file input, not drag-only.

API reference

acceptNone
string

Forwarded to the native input: a comma-separated list of extensions or MIME types.

classNameNone
string

Extra classes merged onto the wrapper.

defaultValue[]
File[]

Starting files when uncontrolled.

disabledNone
boolean

Disables the trigger and the underlying input.

label"Choose file"
string

Text on the trigger button.

multiplefalse
boolean

Allows more than one file, and appends each pick to the list rather than replacing it.

onChangeNone
((files: File[]) => void)

Called with the whole list after a pick or a removal, never with the delta.

valueNone
File[]

Controlled list of picked files. Pair with `onChange`; omit for uncontrolled.

Dropzone props

acceptNone
string

Forwarded to the native input: a comma-separated list of extensions or MIME types.

classNameNone
string

Extra classes merged onto the drop target.

defaultValue[]
File[]

Starting files when uncontrolled.

description"Drag and drop files here, or click to browse"
string

Prose inside the target ("PNG or JPG, up to 5 MB"). Not the accessible name - see `label`.

disabledNone
boolean

Disables the drop target and its input.

label"Upload files"
string

Accessible name for the drop target and its file list. Defaults to "Upload files"; set it when a page has several Dropzones so they are distinguishable ("Upload avatar").

multiplefalse
boolean

Allows more than one file, and appends each drop to the list rather than replacing it.

onChangeNone
((files: File[]) => void)

Called with the whole list after a drop, a pick or a removal.

valueNone
File[]

Controlled list of accepted files. Pair with `onChange`; omit for uncontrolled.

Coding agents read this reference, with its examples, from the version your project has installed, through the Fuji UI MCP server. Set up your agent