Components

Kanban Board

A drag-and-drop kanban board for React with Tailwind CSS and Motion — no dnd library. Drag cards between columns or reorder them: a dashed slot opens where the card will land, neighbours slide out of the way, column counts tick over and the card glides into place on drop. Keyboard users move cards with Alt + arrow keys or a per-card menu, and the board stays fully controlled through columns and onChange.

  • No dnd library
  • Drop slot
  • Layout springs
  • Touch long-press
  • Keyboard moves
  • Controlled state
  • Live announcements

Backlog

3 cards
  • Command menu fuzzy search

    Engmed priorityMV
  • Empty-state illustrations

    Designlow priorityAK
  • Migration guide for v3

    Docsmed priorityJR

In progress

2 cards
  • Kanban keyboard support

    Enghigh prioritySL
  • Dark palette contrast pass

    Designhigh priorityAK

Done

1 cards
  • Release notes 2.4

    Docslow priorityJR

Drag to move. With the keyboard, use the arrow keys to move between cards, Alt plus an arrow key to move the card, or open its menu.

Installation

$ npx shadcn@latest add https://duskui.com/r/kanban.json

Uses the DuskUI Dropdown Menu for the per-card move menu.

Usage

board.tsx
"use client"

import * as React from "react"
import { Kanban, type KanbanColumnData } from "@/components/dusk/kanban/kanban"

const initial: KanbanColumnData[] = [
  { id: "todo", title: "To do", cards: [{ id: "1", title: "Write the brief" }] },
  { id: "doing", title: "Doing", cards: [] },
  { id: "done", title: "Done", cards: [] },
]

export function Board() {
  const [columns, setColumns] = React.useState(initial)
  return <Kanban columns={columns} onChange={setColumns} />
}

Examples

Plain cards & the move payload

Without renderCard cards show their title. The second argument of onChange describes the move, ready to send to your API; moveKanbanCard(columns, move) applies one to any columns array. Empty columns still accept drops.

To do

3 cards
  • Buy oat milk
  • Book dentist
  • Renew passport

Doing

1 cards
  • Plan weekend trip

Waiting on

0 cards

Drag to move. With the keyboard, use the arrow keys to move between cards, Alt plus an arrow key to move the card, or open its menu.

API Reference

Cards need a unique id and a title; any other fields pass through to renderCard. Also accepts any div attribute.

PropTypeDefaultDescription
columns{ id; title; cards: C[] }[]—The board, in column order.
onChange(columns, move: KanbanMove) => void—Called after a drop or keyboard move with the new columns and { cardId, from, to }.
renderCard(card: C) => ReactNodecard.titleCard content. Also used for the drag preview.
getCardLabel(card: C) => stringcard.titleName used in announcements and the move menu.
labelstring"Kanban board"Accessible name of the board region.
columnClassNamestring—Classes for each column (e.g. a different width).

Accessibility

  • The board is a labelled region; each column is a section named by its heading with a list of cards, and counts are read as “3 cards”.
  • Cards are focusable. Arrow keys move focus between cards and columns; Alt + Arrow Up / Down reorders a card and Alt + Arrow Left / Right moves it to the neighbouring column.
  • Each card also has a “Move <card>” menu button listing Move up, Move down and every other column — no drag or shortcut required.
  • Focus follows the card after every keyboard move, and each move, pick-up, drop or cancel is announced through a live region.
  • Press Escape mid-drag to cancel and send the card back. On touch, press and hold a card briefly to pick it up; a quick swipe still scrolls the page.
  • With prefers-reduced-motion, cards snap into place instead of gliding and the drag preview doesn't tilt.