Installation
Usage
import { KanbanBoard } from "@/components/kanban-board"
export function Sprint() {
return (
<KanbanBoard
label="Sprint board"
defaultColumns={[
{ id: "todo", title: "To do", cards: [{ id: "a", title: "Passkey sign-in", label: "High", urgent: true }] },
{ id: "doing", title: "In progress", limit: 3, cards: [{ id: "b", title: "Search ranking", assignee: "Emily Carter" }] },
{ id: "done", title: "Done", cards: [] },
]}
/>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columns / defaultColumns | KanbanColumn[] | [] | The board, kept by you or by the component. A column has id, title, cards, an optional limit and colour. |
| onColumnsChange | (columns, move) => void | — | Called with the new board after a move. |
| label | string | — | Accessible name. |
| canMove | (move) => boolean | — | Veto a move, for example to keep Done closed. |
| highlight | (card) => boolean | — | Dims every card that returns false. |
| renderCard | (card) => ReactNode | — | Replaces the inside of a card. |
Accessibility
- Space or Enter picks a card up; arrow keys move it within and across columns; Space drops it and Escape puts it back.
- Every pick-up, move and drop is announced, so nothing needs a mouse.
- On touch, press and hold picks a card up; swiping still scrolls the board.
- Cards move without animation under prefers-reduced-motion.
Changelog
- v1.0.0Latest
First release.