Drag cards between columns with a line where they land, work-in-progress limits, a filter by person and quick add.
When to use
- Cards in columns you drag between, with work-in-progress limits, a filter by person and quick add.
- Task boards, sales pipelines, hiring and content calendars.
When not to use
- Long lists people sort and filter more than they move: Orders table or a Data Table.
- Work with more than six or so stages: the columns stop fitting; a table with a status filter.
Usage
Kanban board with your own data: every prop has the sample as its default, so pass only what you have.
import { KanbanBoard } from "@/components/dashral/blocks/kanban-board"
<KanbanBoard
title="Sprint 14"
people={team}
columns={columns}
tasks={tasks}
onMove={(id, column, before) => api.tasks.move(id, column, before)}
onAdd={(column, title) => api.tasks.create({ column, title })}
onDelete={(id) => api.tasks.delete(id)}
/>API reference
KanbanBoard
A project board: four columns with counts and work-in-progress limits that warn when crossed. Drag a card to move or reorder it, with a line where it will land; every card's menu moves it too, for the keyboard and touch. Filter by person, and add a task at the bottom of any column. Your board comes from props (a new task list replaces what's shown), and every change goes to your handlers; one that throws is undone, with its message.
| Prop | Type | Default |
|---|---|---|
title | React.ReactNode | "Website relaunch" |
note | stringAfter the count of tasks done. | "launch on Nov 4" |
people | KanbanPerson[] | sample |
columns | KanbanColumn[] | sample |
labels | Record<string, LabelColor>Each label's badge color. | sample |
tasks | KanbanTask[] | sample |
today | DateFor due dates: overdue before it, soon within two days. | sample |
onMove | (id: string, column: string, before: string | null) => Promise<void> | voidA card moved: to this column, before this task (or at the end). | — |
onAdd | (column: string, title: string) => Promise<KanbanTask | void> | KanbanTask | voidA task added at the bottom of a column; return it as stored to show it so. | — |
onDelete | (id: string) => Promise<void> | void | — |
type KanbanPerson
| Prop | Type | Default |
|---|---|---|
id | string | — |
name | string | — |
src | string | — |
type KanbanColumn
A column: its title, a work-in-progress limit that warns when crossed, and its dot's color class. The last is "done".
| Prop | Type | Default |
|---|---|---|
id | string | — |
title | string | — |
limit | number | — |
dot | string | — |
type KanbanTask
| Prop | Type | Default |
|---|---|---|
id | string | — |
title | string | — |
column | ColumnId | — |
label | Label | — |
assignee | string | — |
due | string | — |
comments | number | — |
subtasks | [done: number, total: number] | — |