IN-01Inputs
File Upload
A multi-file upload queue with per-file progress, retry and cancel.
PRONatural Date Input and more like it are in Kokonut UI Pro
Installation
File Upload is a free, open-source React component in the Kokonut UI Inputs collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/file-upload.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/file-uploadOr add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/file-upload.tsx.
npm install lucide-react motionUsage
import FileUpload from "@/components/kokonutui/file-upload";
export default function Example() {
return <FileUpload />;
}Props
onUpload(file: File, helpers: UploadHelpers) => Promise<void>Uploads one file. Called once per file, a few at a time. Resolve to mark the row done, reject to show the error with a Retry button. When omitted, uploads are simulated over uploadDelay.
onUploadSuccess(file: File) => voidonUploadError(error: FileError, file: File) => voidCalled for validation errors and failed uploads.
onComplete(files: File[]) => voidCalled with every uploaded file once nothing is queued or in flight.
onFileRemove(file: File) => voidCalled when a row is removed (cancelling its upload if needed).
acceptedFileTypesstring[]Default built-inMIME types ("image/png"), wildcards ("image/*") or extensions (".pdf").
maxFileSizenumberDefault built-inMaximum size of each file in bytes. Defaults to 5 MB.
multiplebooleanDefault trueAccept several files at once. Defaults to true.
maxFilesnumberDefault 5Maximum number of files in the list. Defaults to 5.
uploadDelaynumberDefault 2000Simulated upload duration per file in ms, used without onUpload.
simulateFailurebooleanDefault falseSimulated uploads only: the first attempt of every third file fails.
validateFile(file: File) => FileError | nullclassNamestringExtra classes for the root element.
UploadHelpers
onProgressrequired(percent: number) => voidReport upload progress from 0 to 100.
signalrequiredAbortSignalAborted when the row is removed or the component unmounts.
FileError
messagerequiredstringcoderequiredstringDependencies
| Needs | Version | Comes from |
|---|---|---|
lucide-react | ^0.556.0 | npm, installed by the CLI |
motion | ^12.23.25 | npm, installed by the CLI |
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.

