OPUS/UI

Navigation

File Upload

Drag-and-drop dropzone with type/size validation, image thumbnails, per-file progress bars and remove buttons.

2 files · 182 locdeps: clsx, tailwind-merge

Installation

With the shadcn CLI, pointing at this platform’s registry:

npx shadcn@latest add https://opusui.131199999.xyz/r/file-upload.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs file-upload

Usage

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

<FileUpload accept="image/*,.pdf" maxSize={5_000_000} onFilesChange={upload} progress={progress} />

API

PropTypeDefaultDescription
accept / multiple / maxSize / maxFilesstring / boolean / number—Constraints.
onFilesChange(files: File[]) => void—Accepted files.
progressRecord<fileName, 0..100>—Drive the bars from your upload code.

Command palette