Kanban
Loading example…
Board of columns with draggable cards and WIP limits. Pointer: drag a card (touch: use the grip). Keyboard: Space or Enter picks a card up, arrows move it, Space or Enter drops it, Escape cancels. Moves are announced in a live region.
Import
Section titled “Import”import { Kanban } from "@jcsoftdev/ui/containers";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/containers/kanban.
<Kanban defaultColumns={columns} enforceLimit={false} emptyLabel="Sin citas"/>| Prop | Type | Default | Description |
|---|---|---|---|
columns |
KanbanColumnData[] |
Controlled board. Pair with onColumnsChange. |
|
defaultColumns |
KanbanColumnData[] |
[] |
|
onColumnsChange |
((columns: KanbanColumnData[], move: KanbanMove) => void) |
Called after a drop (pointer release or keyboard drop) with the new board and the move. | |
draggable |
boolean |
true |
Set to false for a board that only displays: no drag handle, no pointer or keyboard pick-up, and cards are plain content (with cardActions still rendered). Defaults to true. |
enforceLimit |
boolean |
false |
Refuse drops into another column that already reached its WIP limit. |
renderCard |
((card: KanbanCardData) => ReactNode) |
Replaces the default card body. | |
cardActions |
((card: KanbanCardData) => ReactNode) |
Buttons shown under each card. When set, the card is no longer one role="button": its body is plain content, the actions are real, separately focusable controls, and keyboard pick-up moves to a grip button. Without it the card keeps the single-button behavi… |
|
gripLabel |
((card: KanbanCardData) => string) |
(card) => 'Mover tarjeta: ${card.title}' |
Accessible name of the grip button when cardActions is set; defaults to “Mover tarjeta: |
cardGrid |
boolean |
false |
Lays the cards of a lane out as a responsive grid once the lane is 30rem (480 px) wide, with columns of at least cardGridMinWidth; a narrower lane stays a single column. Dropping with the pointer follows reading order; arrow keys still move a held card one … |
cardGridMinWidth |
number |
224 |
Minimum card width (px) of the grid lane. Defaults to 224. |
emptyLabel |
string |
"Sin tarjetas" |
|
aria-label |
string |
||
className |
string |
||
classNames |
Partial<Record<KanbanPart, string>> |
Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last. |
* marks a required prop.
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/containers/kanban/kanban.tsx