Skip to content
caliper ui pro docs

File dropzone

Drop or choose files, with per-file progress, errors and cancel.

Pro

Add the itemised receipt and the card slip.

When to use

  • Attachments and uploads with type and size limits.
  • You want to show upload progress per file.

When not to use

  • A single small file; a native file input is lighter.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/file-dropzone

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

FileDropzone

9 props
PropTypeDefault
labelstring"Add files"
descriptionstring"Drop files here, or choose them."
acceptstring—
maxSizenumber—
multiplebooleantrue
onFilesChange((files: File[]) => void)—
onUpload((item: FileDropzoneItem, report: (percent: number) => void, signal: AbortSignal) => Promise<void>)—
disabledboolean—
classNamestring—

formatFileSize

0 props

No props of its own; it accepts the native props of its root element.

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes progressbar, status and alert semantics, with aria-hidden, aria-valuenow, aria-valuemin, aria-valuemax and aria-label kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/file-dropzone.md

The index of every part is at /llms.txt.

More in Files