Kanban board
A board of columns whose cards move within and across columns, by mouse, touch or keyboard, with every step read out. Column headings count their cards and mark a column that is over its work-in-progress limit. For one list in order, use the sortable list.
Install
npx shadcn@latest add @thrum-pro/kanban-boardThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Automatically installs icon plus from the icon set.
Data shape
type KanbanColumn = {
id: string;
title: string;
limit?: number; // work-in-progress limit
cards: KanbanCard[];
};
type KanbanCard = {
id: string;
title: string;
description?: string;
tags?: string[];
assignee?: { name: string; image?: string };
};[
{ id: "todo", title: "To do", cards: [{ id: "c1", title: "Export invoices", tags: ["Backend"] }] },
{ id: "doing", title: "In progress", limit: 3, cards: [{ id: "c2", title: "Fix the date picker", assignee: { name: "Ada Park" } }] },
{ id: "done", title: "Done", cards: [] },
]Props
| Prop | Type | Default | Description |
|---|---|---|---|
columns | readonly KanbanColumn[] | – | The columns and their cards, when the parent holds them. Use it with onChange. |
defaultColumns | readonly KanbanColumn[] | Default [] | The columns at first, when the board holds them itself. |
onChange | (columns: KanbanColumn[], move: KanbanMove) => void | – | Called when a card is dropped in a new place, with every column in its new state and the move: the card's id, where it was and where it went. |
onAddCard | (columnId: string) => void | – | Called with a column's id when its Add card button is pressed. Add the card to columns here. Without it there is no button. |
addCardLabel | string | Default "Add card" | The text of each column's Add card button. Screen readers also hear the column's name. |
label | string | Default "Board" | The name of the board's scrolling region, read by screen readers. |
sound | boolean | Default true | Play lift, tick and drop sounds while a card moves, if the visitor has sound on. |
className | string | – | Sets the size. Columns grow to fit wide layouts and scroll sideways below 208 pixels per column. |
Motion and sound
Motion
- Cards that make room slide aside with a quick spring that settles without wobble, and a card that changes column slides to its new place.
- During a drag the card under the pointer follows it at once, tilted 2 degrees, and its place in the board shows as a dashed outline.
- Nothing moves on load.
- Reduced motion: cards jump to their new places. The card under the pointer still follows it.
Sound
- Lift when a card is picked up, a tick each time it changes place, and drop when it is set down or the move is cancelled, by pointer or by keyboard. Adding a card is silent.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- Each column is a section named by its heading, and its cards are a list named by the same heading. The count beside the heading is read as 3 cards, limit 4.
- A column over its limit has the warning colour at its edge and the words Over limit beside its count, so the state never rests on colour.
- Each card is a button whose name is its text, tags and assignee. It is described by the instructions, and aria-pressed says when it is lifted.
- Every keyboard step is announced in an assertive live region: lifted, each new place with its column and position, dropped or cancelled. A pointer drop is announced too.
- On a touch screen a card is lifted by holding it for 300 ms, so a swipe still scrolls the board and the page.
- The board is a focusable region named by label, so a keyboard reader can scroll it sideways.
| Keys | Action |
|---|---|
| Tab | Move through the board region, each card and each Add card button. |
| Space / Enter | On a card: lift it. Again: drop it where it is. |
| Up / Down | Move the lifted card within its column. |
| Left / Right | Move the lifted card to the column before or after, at the same height or at the end of a shorter column. Swapped in right-to-left text. |
| Home / End | Move the lifted card to the top or the bottom of its column. |
| Escape | Put the lifted card back where it was. Also cancels a pointer drag. |
| Tab | While a card is lifted: put it back and move on. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/kanban-board.tsx- Packages
motion- Brings along
- AvatarBadgeButtonTagChart foundationsMotion tokensSound engine
- Icons
plus
Changelog
- 1.0.0 · 2026-12-03First release.