columns
Defines the columns on the board. Each entry is a stage (e.g. "To Do", "In Progress", "Done"). Array order sets column order from left to right. Optional: when omitted, the board builds columns from the cards' columnAccessor values - one column per distinct value, labeled with String(value).
Usage
columns?: ColumnConfig[];
| Field | Type | Description |
|---|---|---|
id | string | number | Unique column identifier |
label | string | Display text in the column header |
css | string | CSS class name(s) applied to the column wrapper |
metadata | Record<string, any> | Arbitrary data attached to the column, available in callbacks |
width | number | Fixed outer column width in CSS pixels |
cardWidth | number | Fixed outer card width; enables the card grid layout (PRO) |
cardHeight | number | Fixed outer card height; enables the card grid layout (PRO) |
summaries | ColumnSummaryConfig[] | Ordered summary calculations shown as tags in the column header |
addCard | boolean | Shows the per-column "add card" button in the header. Default: true |
menu | boolean | Shows the header ⋯ button for an outer ColumnActionMenu. Default: false |
collapsed | boolean | Initial collapsed state of the column |
Custom keys (e.g. wipLimit) are passed through to the projected ColumnView, so columnCss, cardCss, card-list slots, and menus read them as column.wipLimit. The keys cards, dataStatus, and summaries are reserved for computed values.
The widget makes a shallow copy of the columns. Changing the host array after passing it in has no effect - change the prop or dispatch update-column.
Example
import { Kanban } from "@svar-ui/react-kanban";
const columns = [
{ id: "todo", label: "To Do" },
{ id: "doing", label: "In Progress", width: 320, addCard: true },
{ id: "done", label: "Done" },
];
const cards = [];
<Kanban columns={columns} cards={cards} />
Related
- Columns guide - layout, grouping, summaries, and column styling
- cards - the card data displayed within columns
- update-column - patch column config at runtime
- columnAccessor - controls card-to-column membership