Skip to main content

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 bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
titlestring—
hintstring—
acceptstring—Accept filter, e.g. "image/*,.pdf".
multipleboolean—
isDisabledboolean—
onFiles(files: File[]) =&gt; void—Fired with the dropped or picked files as a plain array (a copy that stays valid after the picker resets).
iconReact.ReactNode—Override the default upload icon.
idstring—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.
classNamestring—