Skip to main content

Prerequisites

1. Build a dropzone

Drop or pick a file. It appears in the list below the dropzone, with a Remove button; drop a file over 5MB or the wrong type and its rejection reason appears next to it instead. getRootProps() already makes the root click- and keyboard-activatable (Space/Enter opens the file picker) — no separate “Choose files” button is required unless you want one. Pass noClick/noKeyboard/noDrag to useMediaDrop() to opt out of any of that. See Core concepts for the full file model.

2. Add upload

Pass a transport and the hook additionally returns uploadFile/ uploadAll/cancelUpload/cancelAllUploads/retryUpload. Without a transport, none of this exists on the returned object, and TypeScript won’t let you call it.
Click Upload all. Each file’s status moves from queued to uploading to done (or error, with a Retry button). See Upload for the full queue/retry/cancel contract.

Core concepts

File model, store, and drag state

Validation

Restrictions and custom validators

Upload

Queue, concurrency, retry, cancel

useMediaDrop API

Full hook reference