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.

Compact

size="sm" turns the trigger into a one-row drop bar for composers and forms: a control-height surface, start-aligned content, and a smaller default icon. The --cui-dropzone-surface-* knobs size both the trigger and the overlay.

Composition

File intake

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

Compact drop bar

Dropzone size="sm" renders the trigger as one control-height row with start-aligned content, for an attachment bar inside a composer or form. A host that uploads on arrival reads acceptedFiles in onDrop and renders its own previews instead of DropzoneFileList.

  • <Dropzone>
    • <DropzoneInput />
    • <DropzoneArea>
      • <DropzoneTrigger>
        • icon and label
        </DropzoneTrigger>
      • <DropzoneOverlay />
      </DropzoneArea>
    </Dropzone>

Installation

The Control UI source installs this component 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
ButtonbuttonComponentItemitemComponent

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-* · 11 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)
--cui-dropzone-surface-min-block-size<length-percentage>calc(var(--spacing) * 32)
--cui-dropzone-surface-padding-block<length-percentage>calc(var(--spacing) * 6)
--cui-dropzone-surface-padding-inline<length-percentage>calc(var(--spacing) * 6)
--cui-dropzone-surface-gap<length-percentage>calc(var(--spacing) * 3)