File Upload
Drag-and-drop file uploader with instant image previews, size validation, and upload progress feedback.
Drag & Drop File Upload
Generic file dropzone with image previews, max-size validation, upload progress bar, and remove button.
file-upload-example.tsx
Upload Cover Artwork
Drag & drop PNG, JPG, or WebP (max 5 MB)
Quick Import
Example.tsxtsx
1import { FileUpload } from "@rekodo/react";2
3export function Example() {4 return <FileUpload accept="image/*" onFileSelect={(file) => console.log(file)} />;5}API Reference
Props accepted by this component.
| Prop | Type | Default | Description |
|---|---|---|---|
| accept | string | "image/*" | Accepted MIME types or file extensions. |
| maxSizeBytes | number | 10485760 | Maximum allowed file size in bytes (default 10 MB). |
| previewUrl | string | null | undefined | Optional external preview image URL. |
| progress | number | undefined | Displays a progress bar when between 1 and 99. |
| onFileSelect | (file: File | null) => void | undefined | Callback when a file is selected or removed. |