本文へ移動
日本語
「カンバンボード」は Pro に含まれます。解除するとプレビューが表示されます。

仕組み

The board is controlled: it shows a preview order while you drag and calls onChange once on drop. The floating copy is positioned in board coordinates divided by the board's scale, so it stays under the pointer inside zoomed or transformed containers. Every card that moves is animated with FLIP from where it was drawn, including mid-animation. Touch starts a drag after a 220ms press, so a quick swipe still scrolls the page. Below 560px of width the columns stack.

向いている場面

  • Moving work through stages: tasks, hiring pipelines, content calendars.
  • Small to medium boards, up to a few dozen cards per column.

向かない場面

  • Reordering one list: use a sortable list.
  • Hundreds of cards per column: add virtualisation or paging first.

使い方

import { useState } from 'react'
import { KanbanBoard } from './KanbanBoard.jsx'

const columns = [
  { id: 'todo', title: 'To do' },
  { id: 'doing', title: 'In progress', limit: 3 },
  { id: 'done', title: 'Done' },
]

export function Sprint() {
  const [tasks, setTasks] = useState([
    { id: '1', column: 'todo', title: 'Pricing page hero' },
    { id: '2', column: 'doing', title: 'Image compression' },
  ])
  return (
    <KanbanBoard
      columns={columns}
      items={tasks}
      onChange={(next, move) => setTasks(next)}
      renderCard={(task) => <strong>{task.title}</strong>}
    />
  )
}

プロパティ

プロパティ型既定値説明
columns{ id, title, color?, limit? }[]—The columns in order. limit shows count/limit and turns amber when exceeded (it does not block drops).
items{ id, column, ... }[]—The cards; their order within a column is their order in this array.
onChange(items, { id, from, to, index }) => void—Called on drop with the reordered array (the moved card's column updated) and what moved.
renderCard(item) => ReactNode—Card content. The card shell, focus and drag handling come from the board; avoid buttons inside cards.
getTitle(item) => stringitem.titleName used in screen reader announcements.
labelsobject—Replaces built-in text and announcement functions: card, instructions, picked, moved, dropped, cancelled, empty.
...restHTMLAttributes<HTMLDivElement>—Passed to the root. Floating card layer: --ds-kanban-z (40).

アクセシビリティ

  • Each card is a focusable role="button" with aria-roledescription "draggable card" and instructions linked through aria-describedby.
  • Keyboard: Space or Enter picks up, Up / Down move within a column, Left / Right move to the next column, Space or Enter drops, Escape cancels; focus follows the card.
  • Every pick-up, move, drop and cancel is announced in a live region with the column and position.
  • Columns are labelled sections and cards are list items, so counts are announced. Reduced motion removes the tilt, the lift and all sliding.

モーション

Lifting tilts the card 2deg and scales it to 1.03 on a 220ms spring. Neighbours slide out of the way in 260ms. On drop the card travels from the pointer to its slot on a 520ms spring (cubic-bezier(0.3, 1.4, 0.5, 1)), untilting as it lands.

プロジェクトに追加

Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。

KanbanBoard.jsxkanban-board.csstokens.cssREADME.md

2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。

リスト
「アーチ型カルーセル」は Pro に含まれます。解除するとプレビューが表示されます。
「円柱カルーセル」は Pro に含まれます。解除するとプレビューが表示されます。