Skip to content
Components

Dropzone

BetaBeta — the props contract is close to final, but small breaking changes can still land.

Composable file intake with validation, managed selection, and drag-activated overlays.

Examples

Invisible overlay

Document drag tracking reveals a bounded workspace overlay; only the Area accepts the drop.

Composition

File intake

  • <Dropzone>
    • <DropzoneInput />
    • <DropzoneArea>
      • <DropzoneTrigger />
      • <DropzoneOverlay />
      </DropzoneArea>
    • <DropzoneFileList>
      • file render callback
        • file content
        • <DropzoneRemove />
      </DropzoneFileList>
    • <DropzoneRejectionList />
    • <DropzoneStatus />
    • <DropzoneClear />
    </Dropzone>

Installation

The Control UI source installs this primitive from src/registry/sources/control-ui/ui/dropzone.tsx.

Registry command
See registry manifest

Dependencies

Dropzone hooksrc/registry/hooks/use-dropzone.tsHook
Dropzone file policysrc/registry/lib/dropzone-validation.tsSupport
Effectssrc/registry/sources/control-ui/effects.cssSupport
ButtonbuttonPrimitiveItemitemPrimitive

Raw code

Primary installed source

src/registry/sources/control-ui/ui/dropzone.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-dropzone-* · 7 knobsHow the cascade resolves
--cui-dropzone-surface-radius<length-percentage>var(--radius-panel)
--cui-dropzone-surface-foreground<color>var(--foreground)
--cui-dropzone-surface-border-color<color>var(--border)
--cui-dropzone-surface-border-width<length>var(--control-rim-width)
--cui-dropzone-accept-border-color<color>var(--primary)
--cui-dropzone-reject-border-color<color>var(--destructive)
--cui-dropzone-overlay-background<color>oklch(from var(--card) l c h / 0.95)