Components · Data Display
Kanban
BetaAdded v6.5.0
Columns of cards people move by dragging or with Alt+Arrow keys.
import { Kanban } from '@nexub/react';Playground
Props
To do2
- Write release notesDocs
- Update pricing page
In progress1
- Billing migrationBackend
Done1
- Hire designer
<Kanban columns={columns} getId={(t) => t.id} getLabel={(t) => t.title} onChange={setColumns} renderCard={…} />Examples
Task board
Workflow: lanes, WIP limit, archive
States
- Alt+Arrow keys move it
To do2
- Write release notesDocs
- Update pricing page
In progress1
- Billing migrationBackend
Done1
- Hire designer
default - Alt+Arrow keys move it
To do2
- Write release notesDocs
- Update pricing page
In progress1
- Billing migrationBackend
Done1
- Hire designer
readOnly - Alt+Arrow keys move it
To do
In progress
Done
loading
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columnsrequired | KanbanColumn<T>[] | — | The board. |
| getIdrequired | (item: T) => string | — | Stable key and the name read when it moves. |
| getLabelrequired | (item: T) => string | — | Stable key and the name read when it moves. |
| onChangerequired | (columns: KanbanColumn<T>[], move: KanbanMove<T>) => void | — | Called with the columns after a move; store them (and save to your server). |
| renderCardrequired | (item: T) => React.ReactNode | — | The card’s content. |
| readOnly | boolean | false | 11.4: no drag handles, no keyboard moves. |
| canMove | ((move: KanbanMove<T>) => boolean) | — | 11.4: refuse a target before the card lands (a WIP limit, a rule); the drop mark does not show and the keyboard announces it. |
| dropTargets | KanbanDropTarget<T>[] | [] | 11.4: areas outside the columns (Archive, Trash). Alt+Arrow keys reach them after the last column. |
| renderColumnHeader | ((column: KanbanColumn<T>, count: number) => React.ReactNode) | — | 11.4: replace the header (WIP badge, actions); add a slot under the cards (quick add). |
| renderColumnFooter | ((column: KanbanColumn<T>, lane?: KanbanLane) => React.ReactNode) | — | 11.4: replace the header (WIP badge, actions); add a slot under the cards (quick add). |
| lanes | KanbanLane[] | — | 11.4: swimlanes: one row of columns per lane. |
| getLane | ((item: T) => string) | — | 11.4: swimlanes: one row of columns per lane. |
| getTone | ((item: T) => KanbanCardTone) | — | 11.4: a coloured edge on the card; say the meaning in the card text too. |
| columnWidth | 'sm' | 'md' | 'lg' | 'md' (18rem) | 11.4: 15, 18 or 24rem. |
| className | string | — | |
| columnEmptyState | React.ReactNode | — | Shown inside a column that has no cards (while other columns have some). |
| emptyState | React.ReactNode | — | Shown when there is no data. Defaults to the "no data" message. |
| errorState | React.ReactNode | — | Shown in place of the data when a load failed, for example an ErrorState with a retry action. Wins over loading and empty. |
| loading | boolean | — | Shows a skeleton in place of the data and sets aria-busy. |
Accessibility
Keyboard
- Alt+ArrowUp / Alt+ArrowDown
On a handle: moves the card within its column.
- Alt+ArrowLeft / Alt+ArrowRight
Moves the card to the previous or next column. Mirrored in RTL.
Notes
Each column is a region named by its heading. Moves are announced: "Bravo moved to Done, position 2 of 2".
On iOS & Android
Web only
Kanban has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.