Drag, drop, upload
This demo runs on its own: the files fill up to 100%, then start over. Drop or browse to add your own — they begin at 0% and climb.
Upload files
Drag and drop or
MAX FILE SIZE: 20 MB
const MB = 1024 * 1024;
const [files, setFiles] = useState<UploadFile[]>([
{ id: '1', name: 'investor-pitch-deck.pdf', size: 14 * MB,
uploaded: 14 * MB, progress: 100, status: 'complete' },
{ id: '2', name: 'landing-copy-update.docx', size: 4 * MB,
uploaded: 2.7 * MB, progress: 68, status: 'uploading' },
{ id: '3', name: 'product-ui-concepts.fig', size: 14 * MB,
uploaded: 4.5 * MB, progress: 32, status: 'uploading' },
]);
<UploadFiles
files={files}
onFilesSelected={(picked) => {
// kick off your real upload here, then update `files`
setFiles((prev) => [
...prev,
...picked.map((f, i) => ({
id: crypto.randomUUID(),
name: f.name,
size: f.size,
uploaded: 0,
progress: 0,
status: 'uploading' as const,
})),
]);
}}
onRemove={(id) => setFiles((p) => p.filter((f) => f.id !== id))}
onRemoveAll={() => setFiles([])}
onClose={() => {/* close your modal */}}
/>