DropZone
A file drag-and-drop area; also opens the file browser on click.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A file drag-and-drop area; also opens the file browser on click.
Accessibility
Always render a visible <label> (the label prop wires htmlFor/id for you). Errors set aria-invalid and are announced via aria-describedby. Required fields expose aria-required.
Install and import
npx shadcn@latest add @prism/drop-zone
import { DropZone } from '@/components/prism/DropZone';
In a no-build prototype, read it from the bundle instead: const { DropZone } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
title | string | — | |
hint | string | — | |
accept | string | — | Accept filter, e.g. "image/*,.pdf". |
multiple | boolean | — | |
isDisabled | boolean | — | |
onFiles | (files: File[]) => void | — | Fired with the dropped or picked files as a plain array (a copy that stays valid after the picker resets). |
icon | React.ReactNode | — | Override the default upload icon. |
id | string | — | Lands on the native file input, so a <label htmlFor> or a Field points at it: clicking the label opens the picker and names the zone. |
className | string | — |