What this thread does
The problem
You ask a coding agent for a kanban or Trello-like board and get cards that jump, vanish when you press Escape, or cannot drop into an empty column.
What the source says
The official dnd-kit guide on multiple sortable lists (library: clauderic/dnd-kit, MIT, last push 31 October 2026) describes the pattern a board needs:
- Install
@dnd-kit/react; add@dnd-kit/helpersfor itsmoveutility (quickstart). - Each card uses
useSortablewith agroupidentifying its list; each column usesuseDroppableso an empty column can still receive items (the guide shows columns as droppable with low collision priority; the full component code was not visible in the page text I checked). - State is a map of column id to card-id arrays, and the column order lives in a separate array.
onDragOverupdates the card state withmove(...)so the lists update live;onDragEndhandles column reordering.- Pitfall named in the guide: Escape cancels a drag but does not undo your own React state, so take a snapshot of the cards in
onDragStartand restore it when the event is cancelled. - Use stable ids as React keys (general advice: the guide's examples key by column and item id but do not state this as a rule).
How to describe it to the agent
Name the library and the state shape up front, for example: "Build a kanban board with @dnd-kit/react and @dnd-kit/helpers. State is Record<columnId, cardId[]> plus a columnOrder array. Cards in each column share a group; every column is a droppable so empty columns accept cards. Snapshot state on drag start and restore it if the drag is cancelled. Persist only on drag end."
Common mistakes to ask the agent to check
- Saving on every drag-over event.
- Empty columns that cannot receive a card.
- Cancelled drags that leave the card in the wrong column.
- Index-based keys instead of stable ids.
Limits
I did not run this. The guide is the library's own and describes the newer @dnd-kit/react API; older tutorials use @dnd-kit/core and @dnd-kit/sortable, so tell the agent which one to use.
Primary source
Primary source: dnd-kit guide, multiple sortable lists (dnd-kit, clauderic). Checked: @dnd-kit/react with the move helper from @dnd-kit/helpers, per-list group on sortable items, state as column id to item id arrays with a separate columnOrder, onDragOver calling move, onDragEnd for column reordering, and the Escape-cancel snapshot and restore example. Repository push date checked 2026-11-15.
Started from a post by @clauderic, packaged by the editor. Original post