sheengemologic ui
All components

FileDropzone

A native-picker-first file intake surface with drag parity, validation, and app-owned upload state.@gemologic/sheen · forms

Playground

Documents
<FileDropzone label="Documents" accept=".pdf,text/plain" multiple items={[]} onFilesSelected={files => queueUploads(files)} />

Variant matrix

Document intake
Documents

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/FileDropzone.tsx
Tokens
  • --sheen-color-bg-subtle
  • --sheen-color-bg-hover
  • --sheen-color-bg-raised
  • --sheen-color-border
  • --sheen-color-border-control
  • --sheen-color-fg
  • --sheen-color-fg-muted
  • --sheen-color-fg-subtle
  • --sheen-color-accent-fg
  • --sheen-color-accent-subtle
  • --sheen-color-success-fg
  • --sheen-color-danger-fg
  • --sheen-color-focus-ring
  • --sheen-color-focus-ring-offset

Accessibility

Role: native file input and selected-file listKeyboard: Tab, Enter, Space

Do

  • Expose app-owned text status for every queued, uploading, complete, or failed item.

Do not

  • Do not make dropping the only way to select files or start transport inside the component.

Generated props

NameTypeDefaultDescription
refHTMLDivElement | ((element: HTMLDivElement) => void)Native root reference.
inputRefHTMLInputElement | ((element: HTMLInputElement) => void)Native file-input reference.
label *stringRequired visible field label.
descriptionstringSupporting requirements associated with the intake surface.
chooseLabelstringVisible native picker action; defaults to the localized message.
dropLabelstringVisible and announced active-drag instruction.
acceptstringComma-separated native accept hint, also enforced for dropped and selected files.
multiplebooleanfalseAllows more than one file in each native selection; defaults to one.
capture"user" | "environment"Native device capture hint.
maxFilesnumberPositive total item limit, including app-owned existing items.
maxSizenumberPositive maximum file size in bytes.
validateFile(file: File) => string | nullOptional synchronous app validation returning an error message or null.
itemsreadonly FileDropzoneItem[]Serializable app-owned upload records with stable IDs, visible status text, and optional progress.
onFilesSelected *(files: readonly File[]) => voidReceives accepted browser File objects; the app starts and owns transport.
onFilesRejected(rejections: readonly FileDropzoneRejection[]) => voidReceives count, size, type, and custom validation failures.
onRemove(id: string) => voidOptional app-owned removal action by stable item ID.
onRetry(id: string) => voidOptional app-owned retry action shown for error items.
disabledbooleanfalseDisables picker, drop, actions, and selection callbacks.
readOnlybooleanfalseKeeps files inspectable while rejecting picker, drop, retry, and removal.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.