Skip to main content

columns

Defines the columns displayed on the board. Each entry represents a stage (e.g. "To Do", "In Progress", "Done") and the array order determines column order from left to right. Required.

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
cardLimitnumber | booleanSoft cap on cards; drives the overLimit flag for styling
addCardbooleanShows the per-column "add card" button in the header
collapsedbooleanInitial collapsed state of the column

Columns are shallow-copied internally. Mutating 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", cardLimit: 3, addCard: true },
{ id: "done", label: "Done" },
];
const cards = [];
</script>

<Kanban {columns} {cards} />