Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

Kanban

Open .md
Live preview

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 { 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: ”.</td> </tr> <tr> <td><code dir="auto">cardGrid</code></td> <td><code dir="auto">boolean</code></td> <td><code dir="auto">false</code></td> <td>Lays the cards of a lane out as a responsive grid once the lane is 30rem (480 px) wide, with columns of at least <code dir="auto">cardGridMinWidth</code>; a narrower lane stays a single column. Dropping with the pointer follows reading order; arrow keys still move a held card one …</td> </tr> <tr> <td><code dir="auto">cardGridMinWidth</code></td> <td><code dir="auto">number</code></td> <td><code dir="auto">224</code></td> <td>Minimum card width (px) of the grid lane. Defaults to 224.</td> </tr> <tr> <td><code dir="auto">emptyLabel</code></td> <td><code dir="auto">string</code></td> <td><code dir="auto">"Sin tarjetas"</code></td> <td></td> </tr> <tr> <td><code dir="auto">aria-label</code></td> <td><code dir="auto">string</code></td> <td></td> <td></td> </tr> <tr> <td><code dir="auto">className</code></td> <td><code dir="auto">string</code></td> <td></td> <td></td> </tr> <tr> <td><code dir="auto">classNames</code></td> <td><code dir="auto">Partial<Record<KanbanPart, string>></code></td> <td></td> <td>Per-part classes merged with <code dir="auto">cn</code>; consumer classes win. <code dir="auto">className</code> still targets the root and is merged last.</td> </tr> </tbody> </table> <p><code dir="auto">*</code> marks a required prop.</p> <div class="sl-heading-wrapper level-h2"><h2 id="storybook-stories">Storybook stories</h2><a class="sl-anchor-link" href="#storybook-stories"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Storybook stories”</span></a></div> <ul> <li><a href="/storybook/?path=/story/containers-kanban--default">Default</a></li> <li><a href="/storybook/?path=/story/containers-kanban--enforced-limit">Enforced Limit</a></li> <li><a href="/storybook/?path=/story/containers-kanban--with-actions">With Actions</a></li> <li><a href="/storybook/?path=/story/containers-kanban--not-draggable">Not Draggable</a></li> <li><a href="/storybook/?path=/story/containers-kanban--narrow">Narrow</a></li> <li><a href="/storybook/?path=/story/containers-kanban--brutal-preset">Brutal Preset</a></li> <li><a href="/storybook/?path=/story/containers-kanban--glass-compact">Glass Compact</a></li> <li><a href="/storybook/?path=/story/containers-kanban--card-grid">Card Grid</a></li> </ul> <div class="sl-heading-wrapper level-h2"><h2 id="source">Source</h2><a class="sl-anchor-link" href="#source"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Source”</span></a></div> <p><code dir="auto">packages/ui/src/containers/kanban/kanban.tsx</code></p> </div><footer class="sl-flex astro-jvxcb7vc"><div class="meta sl-flex astro-jvxcb7vc"></div><div class="pagination-links print:hidden astro-7ia5zpkt" dir="ltr"><a href="/docs/components/item-card-group/" rel="prev" class="astro-7ia5zpkt"><svg aria-hidden="true" class="astro-7ia5zpkt astro-7qfwp7oc" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-7ia5zpkt">Previous<br class="astro-7ia5zpkt"><span class="link-title astro-7ia5zpkt">ItemCardGroup</span></span></a><a href="/docs/components/kpi/" rel="next" class="astro-7ia5zpkt"><svg aria-hidden="true" class="astro-7ia5zpkt astro-7qfwp7oc" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-7ia5zpkt">Next<br class="astro-7ia5zpkt"><span class="link-title astro-7ia5zpkt">Kpi</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>