Engram

Dnd

component

A generic drag source: makes its `children` draggable and exposes an opaque `data` payload to drop targets.

Install

npx shadcn@latest add @engram/dnd

Registry item: /r/dnd.json — the machine-readable definition agents install from.

Example

Festival Flight
510
Horror's Least
506
Seventh Seraph SAW
503
Equip

Props

api

Draggable

PropTypeDefaultDescription
data*unknownOpaque payload handed to `accept`/`onDrop`.
disabledbooleanfalseDisable dragging (e.g. locked items).
draggingClassNamestring"opacity-50"Class applied while this element is being dragged.
onDragStart(data: unknown) => void
onDragEnd(data: unknown) => void

DropZone

PropTypeDefaultDescription
accept(data: unknown) => booleanReturn false to reject the hovering payload (no drop, no active style).
onDrop(data: unknown) => voidFired with the dropped payload when a valid item is released here.
activeClassNamestring"outline-2 outline-engram-accent"Class applied while a valid payload is hovering.

Own the code: shadcn add copies this component's source into your repo to read and edit directly. Extend without forking — edit the source, use asChild to swap the element, or pass the typed annotations prop for curated data.