File Upload

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.

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.

PropTypeDefaultDescription
acceptstring"image/*"Accepted MIME types or file extensions.
maxSizeBytesnumber10485760Maximum allowed file size in bytes (default 10 MB).
previewUrlstring | nullundefinedOptional external preview image URL.
progressnumberundefinedDisplays a progress bar when between 1 and 99.
onFileSelect(file: File | null) => voidundefinedCallback when a file is selected or removed.