Data Display

KanbanBoard

Controlled multi-column board for reordering cards within and across workflow columns with keyboard, pointer, and live-region feedback.

import { KanbanBoard } from '@lostgradient/cinder';
boardkanbandragreorder
01

Overview

Reference usage

Controlled multi-column board for reordering cards within and across workflow columns with keyboard, pointer, and live-region feedback.

Usage

svelte
<script lang="ts">
  import { Avatar, Badge, KanbanBoard, type KanbanBoardColumn } from '@lostgradient/cinder';

  type WorkItem = {
    id: string;
    title: string;
    assignee: string;
    priority: 'Low' | 'Medium' | 'High';
  };

  let columns = $state<KanbanBoardColumn<WorkItem>[]>([
    {
      id: 'backlog',
      title: 'Backlog',
      cards: [
        {
          id: 'inventory-alerts',
          title: 'Inventory alerts',
          assignee: 'Mina Okafor',
          priority: 'High',
        },
        {
          id: 'weekly-report',
          title: 'Weekly report export',
          assignee: 'Dev Patel',
          priority: 'Medium',
        },
      ],
    },
    {
      id: 'active',
      title: 'Active',
      cards: [
        {
          id: 'shipment-map',
          title: 'Shipment map filters',
          assignee: 'Rae Lindqvist',
          priority: 'High',
        },
        {
          id: 'cycle-count',
          title: 'Cycle count cleanup',
          assignee: 'Alex Moreno',
          priority: 'Low',
        },
      ],
    },
    {
      id: 'done',
      title: 'Done',
      cards: [
        {
          id: 'store-pulse',
          title: 'Store pulse summary',
          assignee: 'Nia Brooks',
          priority: 'Medium',
        },
      ],
    },
  ]);
</script>

<KanbanBoard
  label="Project work board"
  {columns}
  getCardKey={(item) => item.id}
  getCardLabel={(item) => item.title}
  collapsible
  onColumnsChange={(nextColumns) => {
    columns = nextColumns;
  }}
>
  {#snippet cardMeta(item)}
    <Avatar name={item.assignee} size="xs" aria-hidden="true" />
    <span>{item.assignee}</span>
  {/snippet}

  {#snippet cardTrailing(item)}
    <Badge
      variant={item.priority === 'High'
        ? 'danger'
        : item.priority === 'Medium'
          ? 'warning'
          : 'success'}
    >
      {item.priority}
    </Badge>
  {/snippet}

  {#snippet emptyColumn(column)}
    Drop cards into {column.title}
  {/snippet}
</KanbanBoard>

Leave card out and the board lays the card out itself: the title (the getCardLabel text) on top, then one quiet row with cardMeta at its start, in muted text, and cardTrailing at its inline end. Give a person's full name beside their avatar, and hide the avatar from assistive technology (aria-hidden="true") so the name is read once. Pass card instead only when a card needs a body of its own; it then replaces the built-in layout, and cardMeta and cardTrailing are not drawn.

Guidance

Use When

  • Presenting a workflow board where users move cards between ordered columns.
  • Consumers own card rendering and need cinder to manage reorder affordances and change metadata.

Avoid When

  • Showing a single ordered list — use sortable-list instead.
  • Sorting by computed fields rather than direct manual placement.
Live preview

Project board

Press Space to lift a card, arrow keys to move it, Space to drop, and Escape to cancel.

Press Space to lift a column, Left and Right arrows to move it, Space to drop, and Escape to cancel.

Space lifts. Arrow keys move. Space drops. Escape cancels.

Backlog 2 cards
  • Inventory alerts
    Mina Okafor
    High
  • Weekly report export
    Dev Patel
    Medium
Active 2 cards
  • Shipment map filters
    Rae Lindqvist
    High
  • Cycle count cleanup
    Alex Moreno
    Low
Done 1 card
  • Store pulse summary
    Nia Brooks
    Medium

02

When to use

Use when
  • Presenting a workflow board where users move cards between ordered columns.
  • Cards need a title over one quiet row (an assignee, a priority badge), or consumers own card rendering.
Avoid when
  • Showing a single ordered list — use sortable-list instead.
  • Sorting by computed fields rather than direct manual placement.
03

Examples

Project board

Move work items between columns, reorder columns, and collapse quiet lanes. Each card shows its title, then its assignee and priority on one quiet row.

04

Props

Props for kanban-board
Name
Type
Default
Description
columns required KanbanBoardColumn<Card>[]
getCardKey required (card: Card) => stringnumber
getCardLabel required (card: Card, column: KanbanBoardColumn<Card>, index: number) => string
onColumnsChange required (nextColumns: KanbanBoardColumn<Card>[], change: KanbanBoardChange) => void
card snippet Replaces the card's whole body. Leave it out to use the built-in layout: the card's title (its getCardLabel text) on top, then one quiet row of cardMeta with cardTrailing at its inline end. When card is set, cardMeta and cardTrailing are not drawn.
cardMeta snippet The built-in card's quiet row under the title, such as an assignee's avatar and full name. It draws in muted text at the inline start of the row.
cardTrailing snippet The built-in card's inline-end item on the meta row, such as a priority badge.
columnHeader snippet
columnActions snippet
emptyColumn snippet
label text Accessible label applied to the board's <section> root via aria-label.
collapsible boolean false When true, each column renders a collapse/expand button that toggles its card list.
reorderColumns boolean true When true (default), columns can be reordered by dragging or keyboard. Set to false to make column order fixed.