Skip to main content

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[];
FieldTypeDescription
idstring | numberUnique column identifier
labelstringDisplay text in the column header
cssstringCSS class name(s) applied to the column wrapper
metadataRecord<string, any>Arbitrary data attached to the column, available in callbacks
widthnumberFixed outer column width in CSS pixels
cardWidthnumberFixed outer card width; enables the card grid layout (PRO)
cardHeightnumberFixed outer card height; enables the card grid layout (PRO)
summariesColumnSummaryConfig[]Ordered summary calculations shown as tags in the column header
addCardbooleanShows the per-column "add card" button in the header. Default: true
menubooleanShows the header ⋯ button for an outer ColumnActionMenu. Default: false
collapsedbooleanInitial 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​

<script>
import { Kanban } from "@svar-ui/svelte-kanban";

const columns = [
{ id: "todo", label: "To Do" },
{ id: "doing", label: "In Progress", width: 320, addCard: true },
{ id: "done", label: "Done" },
];
const cards = [];
</script>

<Kanban {columns} {cards} />