Skip to content

Kanban board

Columns of draggable cards with keyboard moves, animated travel between columns and a lifted drag overlay. Adapted from Kibo UI (MIT).

onDataChange receives every preview while a card is over another column; onCommit is called once per completed drop and is where to save. Change data yourself (a button, a menu, a live update) and the card glides to its new column; with reduced motion it fades in there instead. The board is as wide as its columns, so put it in a container that scrolls sideways.

Board

To do

Write the migration guide

Fix the export time zone

In progress

Add keyboard shortcuts to the editor

Review the pricing page copy

Done

Confirm the launch date

Nothing has moved yet.

Card content

Draft1

INV-1043

Orchard API€9,100

Issued2

INV-1042

Atlas redesign€4,800

INV-1041

Billing migration€12,250

Paid0

No paid invoices

Moved by a button

To do

Freeze the release branch

Publish the release notes

In progress

Run the database migration

Done

List rows

To do

Write the migration guide
Fix the export time zone

In progress

Review the pricing page copy

Done

Disabled

Planned

4.3.0: shared views

Shipped

4.2.0: offline drafts

4.1.2: faster search

Installation

npx shadcn@latest add @khaeli/kanban-board

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

npm packages
  • @dnd-kit/core ^6.3.1
  • @dnd-kit/sortable ^10.0.0
  • @dnd-kit/utilities ^3.2.2
  • motion ^12.23.12
  • tunnel-rat ^0.1.2

Keyboard

Tab
Moves to each card's move button, named Move and the card's name. It draws as the card's focus ring. Controls inside a card are tab stops of their own, after it.
SpaceEnter
Lift the focused card, and drop it where it is. The button's description says how: press space to pick up, the arrow keys to move, space again to drop, escape to cancel. A lifted card is read out as being over itself, a drop as Move completed, and focus returns to the card. Tab while a card is lifted drops it too.
ArrowLeftArrowRightArrowUpArrowDown
While lifted: move the card to the nearest card or column in that direction, and read out what it is over. A press can land on a neighbour in the same column first, so the next column takes one to three presses; an arrow up or down at the end of a column can cross to the next one too. The card moves to another column at once and takes its place inside a column on the drop.
Escape
While lifted: puts the card back where it was. Read out as Move cancelled.

Accessible name

  • name on KanbanCard is required: it names the move button and is what the announcements say, even when children draw the card.
  • name on each column is what a move is read out as being over. Put the same text in the KanbanHeader.
  • Rows (variant="row") have no move button and cannot be lifted from the keyboard. Give each row a control of its own that changes its column, such as a select, and name it after the row.
  • With disabled the move buttons are disabled: cards cannot be lifted and are not tab stops.
  • The lifted copy that follows the pointer is hidden from assistive technology.
  • KanbanCards is a list of its cards. While a column has no cards it draws empty in its place and is not a list, so the text is read as plain content.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/kanban-board.json