Shadcn-style File Upload
InputShadcn-style file upload for React. Drag-and-drop file upload with preview, validation, and progress.
File UploadInput · Web
Loading Storybook preview…
Installation
bun add @otfdashkit/ui
Usage
Import File Upload from @otfdashkit/ui.
Code
// File Upload — Shadcn-style file upload for React. Drag-and-drop file upload with preview, validation, and progress.
//
// Install:
// bun add @otfdashkit/ui
import { FileUpload } from '@otfdashkit/ui'
export function Example() {
return (
<FileUpload>
{/* your content */}
</FileUpload>
)
}Props
Props declared in the FileUpload source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| accept | string | ||
| className | string | ||
| disabled | boolean | ||
| maxSize | number | ||
| multiple | boolean | ||
| onFiles | (files: File[]) => void |
Related
Upload progress bar
Pair the file upload with OTF's Progress component. Pass the current upload percentage as its value.
import { Progress } from '@otfdashkit/ui'
<Progress value={65} aria-label="Upload progress" />