Kanban Board

Multi-column task board for moving cards between workflow stages with keyboard and drag-and-drop support.

@drift-ui/kanban-boardRegistry JSONOpen in v0
Press Space to pick up, Up and Down to move within the column, Left and Right to move across columns, Space to drop, Escape to cancel.

To do

2
Quarterly roadmap review
Strategy
Design token audit
Design

In progress

1
Passkey authentication
Security

Done

1
Optimize bundle size
Performance

Keyboard

SpaceEnter
Pick up or drop a card
↑↓
Move card within column
←→
Move card across columns
Escape
Cancel the move
On this page

Installation

The CLI also installs the npm packages and registry items it builds on, and reads the style in your components.json to pick the Base UI or Radix build.

Usage

kanban-board-usage.tsx
"use client"

import { useState } from "react"
import { KanbanBoard } from "@/components/ui/kanban-board"

interface Task {
  id: string
  title: string
}

export function ProjectBoard() {
  const [tasks, setTasks] = useState<Record<string, Task[]>>({
    todo: [{ id: "1", title: "Refactor API" }],
    doing: [{ id: "2", title: "Add unit tests" }],
    done: [{ id: "3", title: "Update docs" }],
  })

  return (
    <KanbanBoard
      aria-label="Sprint tasks"
      columns={[
        { id: "todo", title: "To do" },
        { id: "doing", title: "In progress" },
        { id: "done", title: "Done" },
      ]}
      value={tasks}
      onValueChange={setTasks}
      onMove={(task, from, to, index) => {
        console.log(`Moved ${task.title} from ${from} to ${to} at index ${index}`)
      }}
    />
  )
}

Examples

Granular moves with onMove

onMove reports the exact card, previous column, target column, and index so you can persist changes without diffing the full board.

Press Space to pick up, Up and Down to move within the column, Left and Right to move across columns, Space to drop, Escape to cancel.

New leads

2
Alex Chen$12k
Acme Corp
Sarah Miller$45k
Starlight Inc

Contacted

1
David Kim$28k
Nexus AI

Negotiation

0
No cards

Closed won

1
Elena Rostova$60k
Hyperion Labs

Empty column states

renderEmptyColumn customizes the drop target when a column has no cards.

Press Space to pick up, Up and Down to move within the column, Left and Right to move across columns, Space to drop, Escape to cancel.

Reported

2
Mobile safari sticky header flicker
Dark mode contrast in table rows

Triaged

0
Drop here to markTriaged

Resolved

0
Drop here to markResolved

API reference

KanbanBoard

Multi-column task board for moving cards between workflow stages with keyboard and HTML5 drag-and-drop support. Space picks up a card, arrow keys move it within or across columns, Space drops it, and Escape cancels.

Prop
columnsRequiredKanbanColumn[]List of columns with id, title, and optional description.
valueRecord<string, T[]>Controlled map of column ids to card arrays.
defaultValueRecord<string, T[]>Default{}Initial value when uncontrolled.
onValueChange(value: Record<string, T[]>) => voidCalled when any card is moved or reordered.
onMove(card: T, fromColumnId: string, toColumnId: string, toIndex: number) => voidFires when a card is moved between columns or reordered within a column, reporting the specific transition.
renderCard(card: T, info: { columnId: string; index: number; isGrabbed: boolean }) => ReactNodeRender function for each card.
renderColumnHeader(column: KanbanColumn, cards: T[]) => ReactNodeCustom render function for column headers.
renderEmptyColumn(column: KanbanColumn) => ReactNodeCustom placeholder rendered when a column has no cards.
getCardId(card: T, index: number) => stringDefaultgetDefaultCardIdReturns a unique key for each card.
getCardLabel(card: T, index: number) => stringDefaultgetDefaultCardLabelReturns accessible label for screen readers and live region announcements.
disabledbooleanDefaultfalseDisables drag-and-drop and keyboard grabbing.

Other props go to the <div>.

kanban-board-utils

moveCard<T>(board: Record<string, readonly T[] | undefined>, cardId: string, toColumnId: string, toIndex: number, getCardId?: (card: T, index: number) => string): MoveCardResult<T>; findCardLocation<T>(board: Record<string, readonly T[] | undefined>, cardId: string, getCardId?: (card: T, index: number) => string): KanbanCardLocation<T> | null; reorderCardInColumn<T>(cards: readonly T[], fromIndex: number, toIndex: number): T[]; getPickupAnnouncement(cardLabel: string, columnTitle: string, index: number, total: number): string; getMoveAnnouncement(cardLabel: string, columnTitle: string, index: number, total: number): string; getDropAnnouncement(cardLabel: string, columnTitle: string, index: number, total: number): string; getCancelAnnouncement(cardLabel: string, originalColumnTitle: string, originalIndex: number, total: number): string

Pure logic functions for moving cards between columns, finding card locations, and formatting ARIA live region announcements. Import from @/lib/kanban-board-utils.

Source

components/ui/kanban-board.tsx