File upload component with drag-and-drop, type filtering, size and count limits, supporting single and multiple modes.
Images or PDF up to 5 MB
Add up to 5 workspace files
Compact feedback for files already added
product-roadmap.pdf
customer-import.csv
brand-video.mov
Inset surface
Clear border
Quiet upload
pnpm dlx shadcn@latest add https://matos-ui.com/r/file-upload.jsonimport { FileUpload } from '@/components/matos-ui/file-upload'<FileUpload
files={files}
onFilesChange={setFiles}
accept="image/*,.pdf"
maxSize={5 * 1024 * 1024}
/>| Prop | Type | Default |
|---|---|---|
files | FileUploadFile[] | — (uncontrolled if omitted) |
onFilesChange | (files: FileUploadFile[]) => void | — |
accept | string | — |
multiple | boolean | false |
maxSize | number | — |
maxFiles | number | — |
title | string | "Drag and drop your files" |
description | string | "or click to select a file" |
disabled | boolean | false |
size | "sm" | "md" | "lg" | "md" |
variant | "default" | "outline" | "ghost" | "default" |
export interface FileUploadFile {
file: File
id: string
error?: string
}FileUpload forwards standard props to <div role="button">. Internally it renders an <input type="file" className="sr-only" />.
Also exported: fileUploadVariants with slots root / icon / title / description / fileList / fileItem / fileName / fileSize / removeButton / errorText for easy customisation via tailwind-variants.
Install Matos UI
Choose a package manager and copy one command for every component.