bloxa

File Upload

FREE

Drag-and-drop zone with type and size validation, image previews, file list and progress bars.

Playground

Change the props and watch the component and its code update live.

Props
Code
import { FileUpload } from "@/components/ui/file-upload";

<FileUpload
  accept="image/*"
  maxFiles={4}
  maxSize={5 * 1024 * 1024}
  onValueChange={(files) => upload(files)}
/>

Installation

Terminal
npx @bloxa/cli add file-upload
# or: npx shadcn@latest add @bloxa/file-upload

Examples

Images with progress

Drop images to see previews and a simulated upload progress.

Single file

API reference

Every component also accepts the props of the element it renders.

FileUpload

PropTypeDefaultDescription
value / defaultValueFile[]—Selected files.
onValueChange(files: File[]) => void—Called when files change.
acceptstring—Allowed types, e.g. "image/*,.pdf".
multiplebooleantrueMultiple files.
maxSizenumber—Max size per file in bytes.
maxFilesnumber—Maximum number of files.
progressRecord<string, number>—Upload percentage by file name (0–100).
labels{ title?, browse?, hint?, ... }—UI strings (for translation).