Put a DropzoneArea inside Dropzone. The rules line comes from the checks. The component never uploads: your app sends each file.
attachments.tsx
Dropzone
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| accept | Accept | AcceptGroup[] | — | |
| min | number | — | |
| max | number | — | |
| max | number | 0 | |
| prevent | boolean | — | |
| no | boolean | true | |
| no | boolean | — | |
| no | boolean | — | |
| no | boolean | — | If true, disables paste-to-upload. By default, when the dropzone (or a focused child) receives a paste that carries files - e.g. a screenshot pasted with Ctrl/Cmd+V - those files go through the same accept/size/validator checks and onDrop callbacks as a drop. Pastes with no files (plain text, etc.) are ignored and left untouched. See https://github.com/react-dropzone/react-dropzone/issues/1210 |
| disabled | boolean | false | |
| on | — | ||
| on | — | ||
| on | — | ||
| get | — | ||
| on | — | ||
| on | — | ||
| on | — | ||
| validator | — | Custom validation, run once per file on drop/selection. Return null to accept the file, or a FileError (or array of them) to reject it. May be async (return a Promise) to support checks that can't run synchronously - e.g. reading image dimensions, inspecting file contents, or calling an external service. While an async validator is pending, DropzoneState.isProcessing is true, and onDrop/onDropAccepted/onDropRejected fire only once it settles. If the validator throws or rejects, onError is called and the drop is discarded. Note: the validator never runs during a drag (a DataTransferItem has no name/size), so a validator-configured dropzone is isDragUnknown until drop. | |
| get | — | Override the message of any rejection error (built-in or custom). Called once per error; receives the error and the file it belongs to and returns the message to use. Return error.message for codes you don't want to change. Useful for localizing error messages. | |
| use | boolean | — | |
| auto | boolean | false | |
| labels | Partial<DropzoneLabels> | — | The words the Dropzone writes itself: state titles, the rules line, sources (DROPZONE_LABELS). |
| files | readonly File[] | — | The accepted files (controlled). |
| default | readonly File[] | — | The accepted files at first (uncontrolled). |
| on | — | Runs when a drop, a pick, a paste, or a remove changes the list. | |
| name | string | — | The form field name: a normal form submit sends the files under it. |
| required | boolean | false | The form needs at least one file (native validation on submit). |
| read | boolean | false | The list shows, but nothing adds files: no dialog (also not from a label click), no drop, and no paste; the trigger is off. Render no remove buttons then. Default false. |
| invalid | boolean | false | Shows the area as invalid (a red edge), for an error that the app sets. |
| no | boolean | false | A click on the area does not open the dialog; only the trigger does. Default false. |
| locale | LocalesArgument | — | The locale of the sizes in the messages and the file list. |
| directory | boolean | false | The dialog picks a folder (webkitdirectory), and every file in it is added. A dropped folder always works. Not with useFsAccessApi: that picker cannot choose folders. |
| capture | "environment" | "user" | boolean | — | The camera on a phone (capture of the file input): "environment" (back) or "user" (front). Android opens only the camera then. For a choice of camera or gallery, use two Dropzones, each with its own trigger. |
| actions | — | Gets open (the file dialog, for a menu item or a shortcut, in the press itself), clear (empties the list), and clearRejections. | |
| class | string | — | |
| children | ReactNode | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>. |
DropzoneArea
<div>DropzoneMedia
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| size | "default""sm""xs" | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DropzoneContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DropzoneTitle
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
DropzoneDescription
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
DropzoneTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | "sm" | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | "outline" | |||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| focus | boolean | — | Takes the focus when it mounts. Default: the autoFocus of the root. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
DropzoneOverlay
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DropzoneRejections
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| children | — | One line for one message. Default: the message, then the file names. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DropzoneIdle
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — |
DropzoneAccept
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — |
DropzoneReject
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — |
DropzoneRules
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
DropzoneCount
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
DropzonePasteHint
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
DropzoneSources
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal""vertical" | "horizontal" | A row of ghost buttons under the trigger (default), or a column (a side list in a dialog). |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DropzoneSource
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| kind | "camera""device""folder""link" | — | - device: the file dialog. - folder: a folder dialog (webkitdirectory); every file in it is added with its path. - camera: the camera on a phone (capture); a desktop opens the file dialog. - link: a popover with a link field; onLink gets the link and returns the file. | ||||
| facing | "environment""user" | — | The camera of camera: "environment" (back, default) or "user" (front). | ||||
| on | — | For link: get the file of a link (fetch it in your app, with your own checks of the host). The files go through the same checks as a drop. Throw an Error to show its message. | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
DropzoneIllustration
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| kinds | — | The three kinds of the fan, start to end. Default: from accept, else PDF, image, sheet. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| EnterorSpace | On DropzoneTrigger: opens the file dialog. |
|---|---|
| ⌘VorCtrlV | Focus on a part inside the area: pastes files. |
| EnterorSpace | On the area, with noKeyboard={false}: opens the file dialog. |











