File Upload
Selects and validates files through a native picker or drag and drop.
@rivetui/file-uploadPreview
Explore each composition interactively, then open its code in the same context.
Default
Accept multiple files with shared type, count, and size constraints.
Note
Set
disabled on FileUpload to disable the dropzone and file controls together.Compact
Fit file selection into a standard control row without losing drag and drop.
Single file
Omit multiple when the workflow accepts exactly one file.
Registry
Installation
Add the component source and its declared dependencies with the shadcn CLI.
Install component
bunx --bun shadcn@latest add @rivetui/file-uploadPublic interface
API reference
Component-specific props are listed here. Native element and Base UI props continue to pass through.
FileUpload
| Prop | Type | Default |
|---|---|---|
value | File[] | — |
defaultValue | File[] | [] |
onValueChange | (files: File[]) => void | — |
accept | string | — |
multiple | boolean | false |
maxFiles | number | 1 / ∞ when multiple |
maxSize | number | — |
disabled | boolean | false |
onFileReject | (rejection: FileUploadRejection) => void | — |
FileUploadDropzone
| Prop | Type | Default |
|---|---|---|
size | "sm" | "md" | "md" |
className | string | — |
Use size="sm" for a button-height picker. The compact layout keeps click and drag-and-drop behavior and shows the selected filename inline.