Columns
Columns are the stages cards move through - "Backlog", "In Progress", "Done", or whatever stages your workflow uses. This guide covers column setup, layout and scroll options, grouping by different fields, and runtime styling.
Defining columns
To define columns explicitly, pass a columns array. Each entry must have at least an id and a label, the array order sets the left-to-right display order.
<script setup>
import { Kanban } from "@svar-ui/vue-kanban";
const columns = [
{ id: "backlog", label: "Backlog" },
{ id: "todo", label: "To Do" },
{ id: "doing", label: "In Progress" },
{ id: "done", label: "Done" },
];
const cards = [];
</script>
<template>
<Kanban :cards="cards" :columns="columns" />
</template>

A column object supports these fields:
id- unique identifier (string or number)label- display text shown in the column headercss- static CSS class applied to the column rootmetadata- freeform object for host-specific datawidth- fixed outer width in pixels for this columncardWidth/cardHeight- fixed card size that turns the column into a card grid (PRO)summaries- list of summary tags shown in the headeraddCard- whether the "+" button appears in the header (defaults totrue)menu- whether the⋯menu button appears in the header (defaults tofalse)collapsed- initial collapsed state
You can also add your own keys, such as wipLimit or owner. The board copies them to the projected column, so callbacks like columnCss, summary format, and card list slots can read them. Three names are reserved because the board computes them: cards, dataStatus, and summaries (on the projected column, summaries holds the calculated tags, not your definitions).
Columns are shallow-copied on init. Mutating the original array after passing it in won't do anything - change the prop or dispatch update-column.
Columns from data
The columns prop is optional. Leave it out, and the board builds columns from the cards: one column for each distinct value that the columnAccessor reads.
<script setup>
import { Kanban } from "@svar-ui/vue-kanban";
const cards = [
{ id: 1, label: "Plan onboarding", status: "To do" },
{ id: 2, label: "Build search", status: "In progress" },
{ id: 3, label: "Update dependencies", status: "Done" },
{ id: 4, label: "Write release notes", status: "To do" },
];
</script>
<template>
<Kanban :cards="cards" columnAccessor="status" />
</template>
This board shows three columns: "To do", "In progress", and "Done". Inference follows these rules:
- Columns appear in the order their ids first appear in the card data.
- Each label is
String(id). - Cards with a missing value, or a value that isn't a string or number, add no column.
- If no card has a column id (or there are no cards), the board shows one unnamed column with all cards. Your card data stays unchanged.
Inferred columns are rebuilt whenever cards or the accessor change. Filtering and sorting don't rebuild them. Since a rebuild replaces the generated configs, empty columns and any runtime changes to inferred columns (a new label, a collapsed state) disappear at the next card change.
Passing any array turns inference off, even an empty one (:columns="[]"). For editable boards with a fixed set of stages, pass an explicit columns array.
Column accessor
By default, each card carries a column field that matches a column id. The columnAccessor prop controls how the store reads and writes that membership.
To use a different property name, pass a string:
<template>
<Kanban :cards="cards" :columns="columns" columnAccessor="stage" />
</template>
Now every card needs a stage field whose value matches a column id.
When column membership is derived rather than stored as a flat property, pass an object with get and set callbacks:
<script setup>
const userAccessor = {
get: (card) => card.user,
set: (card, value) => ({
...card,
user: value,
users: [value],
}),
};
</script>
<template>
<Kanban :cards="cards" :columns="columns" :columnAccessor="userAccessor" />
</template>
get reads the column id from the card. set returns the card object with the updated membership - the board calls it when a user drags a card to another column. set receives a shallow copy of the card, so you can also mutate the argument and return it.
Grouping by other fields
Switch columnAccessor and columns together to regroup cards by a different dimension without recreating the widget. You can view the same dataset by stage, priority, or assignee.
<script setup>
import { ref, computed } from "vue";
import { Kanban } from "@svar-ui/vue-kanban";
const stageColumns = [
{ id: "backlog", label: "Backlog" },
{ id: "todo", label: "To Do" },
{ id: "doing", label: "In Progress" },
];
const priorityColumns = [
{ id: 1, label: "Low" },
{ id: 2, label: "Medium" },
{ id: 3, label: "High" },
];
const groupBy = ref("stage");
const columns = computed(
() => groupBy.value === "stage" ? stageColumns : priorityColumns
);
const columnAccessor = computed(
() => groupBy.value === "stage" ? "stage" : "priority"
);
</script>
<template>
<Kanban :cards="cards" :columns="columns" :columnAccessor="columnAccessor" />
</template>
When the accessor is a string, each card must have that field with a value matching one of the column ids. With a get/set object, get decides which column each card belongs to.
Column header actions
Each column header has a collapse toggle and an add-card button. You can also add a ⋯ menu button and a right-click menu.
The collapse toggle is always present. Clicking it dispatches update-column to flip the collapsed flag. Collapsed columns show an expand button and a rotated label but don't render their card list. Collapse works even in readonly mode.
The add-card button shows when addCard isn't explicitly false and readonly is off. Clicking it creates a new card in that column and opens the editor.
To hide the button on specific columns, set addCard: false:
<script setup>
const columns = [
{ id: "backlog", label: "Backlog" },
{ id: "done", label: "Done", addCard: false },
];
</script>
Column menu
Set menu: true on a column to show a ⋯ button in its header, between the summary tags and the "+" button. The board renders only the button. To open a menu on click, wrap <Kanban> in <ColumnActionMenu>. To open the same menu on header right-click, wrap it in <ColumnContextMenu>. The right-click menu works on every column, with or without menu: true.
<script setup>
import { ref } from "vue";
import {
Kanban,
ColumnActionMenu,
ColumnContextMenu,
} from "@svar-ui/vue-kanban";
const api = ref(null);
const columns = [
{ id: "todo", label: "To Do", menu: true },
{ id: "doing", label: "In Progress", menu: true },
{ id: "done", label: "Done" },
];
</script>
<template>
<ColumnContextMenu :api="api">
<ColumnActionMenu :api="api">
<Kanban ref="api" :cards="cards" :columns="columns" />
</ColumnActionMenu>
</ColumnContextMenu>
</template>
Both wrappers show the default items from getColumnMenuOptions(). The ⋯ button takes some header space, so widen the column or turn off other header features if the label gets too short. For custom items and handlers, see the menu guide.
Column summaries
Summaries are small tags in the column header, such as total effort, the number of blocked cards, or a 3/5 capacity counter. Define them in the column's summaries array. Each summary has:
id- unique key within the columncalculate(cards, column)- returns a value from the column's cardsformat(value, column)- optional, returns the tag text (defaults toString(value))css(value, column)- optional, returns CSS classes for this tag only
<script setup>
import { Kanban } from "@svar-ui/vue-kanban";
const summaries = [
{
id: "effort",
calculate: cards =>
cards.reduce((sum, card) => sum + (card.estimateHours ?? 0), 0),
format: value => (value ? `${value} h` : ""),
css: value => (value > 40 ? "effort-over-capacity" : ""),
},
{
id: "blocked",
calculate: cards => cards.filter(card => card.blocked).length,
format: value => (value ? `${value} blocked` : ""),
},
];
const columns = [
{ id: "todo", label: "To do", summaries },
{ id: "doing", label: "Doing", summaries },
{ id: "done", label: "Done", summaries },
];
</script>
<template>
<Kanban :cards="cards" :columns="columns" />
</template>

calculate gets the column's cards after filtering and sorting, across all swimlanes. The board recalculates summaries after every card change, filter, sort, data load, column update, and undo/redo.
To hide a tag, return null or undefined from calculate or format, or return blank text. Above, format returns "" for zero, so empty values don't clutter the header. Empty columns show no tags at all. If a callback throws, the board logs the error and skips only that tag.
WIP limits
Use a summary for a work-in-progress limit. Store the limit in a custom column key, count the cards, and compare:
<script setup>
import { Kanban } from "@svar-ui/vue-kanban";
const capacity = {
id: "capacity",
calculate: cards => cards.length,
format: (value, column) => `${value}/${column.wipLimit}`,
css: (value, column) =>
value > column.wipLimit ? "capacity-exceeded" : "",
};
const columns = [
{ id: "todo", label: "To do", wipLimit: 5, summaries: [capacity] },
{ id: "doing", label: "Doing", wipLimit: 3, summaries: [capacity] },
{ id: "done", label: "Done" },
];
function columnCss(cards, column) {
return column.wipLimit && cards.length > column.wipLimit
? "column-over-limit"
: "";
}
</script>
<template>
<Kanban :cards="cards" :columns="columns" :columnCss="columnCss" />
</template>
<style>
.wx-column-summary.capacity-exceeded {
color: var(--wx-color-danger);
}
.wx-column.column-over-limit {
background: #fdecec;
}
</style>
The summary's css styles only the tag. To color the whole column, use columnCss: the projected column carries the same wipLimit key. The limit is soft. Cards can still move into a full column. Tag styles need at least .wx-column-summary.your-class specificity to override the defaults.
To replace or remove summaries at runtime, dispatch update-column with a new summaries array (summaries: [] clears them).
Card list slots
Use cardListStart and cardListEnd to render your own component above or below the cards in each column, for example a column intro or an "Add card" button at the end of the list.
<script setup>
import { Kanban } from "@svar-ui/vue-kanban";
import CardListStart from "./CardListStart.vue";
import CardListEnd from "./CardListEnd.vue";
</script>
<template>
<Kanban
:cards="cards"
:columns="columns"
:cardListStart="CardListStart"
:cardListEnd="CardListEnd"
/>
</template>
Each slot component receives CardListSlotProps:
column- the projected columnswimlane- the swimlane, for a swimlane cell or stack group onlycards- all filtered and sorted cards of this list, including ones outside the virtual rangereadonly- the board'sreadonlystate
<!-- CardListStart.vue -->
<script setup>
const props = defineProps({
column: { type: Object },
cards: { type: Array },
});
</script>
<template>
<div class="intro">
<strong>{{ props.column.label }}</strong>
<span>{{ props.cards.length }} cards</span>
</div>
</template>
Slots scroll with the cards. They aren't cards: you can't drag them, they don't count as items, and double-clicking them doesn't add a card. When a user drops a card over the start slot, the card goes to the start of the list. A drop over the end slot puts it at the end. Slots don't render in collapsed columns or in exports.
The slots do nothing by themselves. Any action, such as adding a card through api.exec("add-card", ...), is your code, and it should respect readonly. See cardListStart and cardListEnd.
Layout: scroll and width
The render prop controls column layout and scrolling. Two independent settings drive it: columnScroll and fixedColumnWidth.
Scroll modes
render.columnScroll sets whether each column scrolls independently or the whole board shares one vertical scrollbar.
columnScroll: true(default) - each column has its own vertical scrollbar. Headers stay pinned at the top of each column.columnScroll: false- the board becomes one tall scroll surface. All columns scroll together, and headers stick to the top of the viewport.
<template>
<Kanban :cards="cards" :columns="columns" :render="{ columnScroll: false }" />
</template>
Swimlanes and the stack layout always use board scroll and ignore columnScroll.
Column width
render.fixedColumnWidth controls whether columns have a uniform pixel width or share the available space.
fixedColumnWidth: true(default) - every column is 280px wide. Horizontal scrolling appears when the columns overflow the viewport.fixedColumnWidth: false- columns share the viewport width equally, with a minimum floor of 240px each. Horizontal scrolling appears only when the total minimum width exceeds the viewport.
<template>
<Kanban
:cards="cards"
:columns="columns"
:render="{ fixedColumnWidth: false }"
/>
</template>
These two settings are orthogonal. All four combinations work:
columnScroll | fixedColumnWidth | Result |
|---|---|---|
true | true | Classic board. Each column scrolls independently, fixed width. |
true | false | Columns fill the viewport, each scrolls independently. |
false | true | Board-wide scroll with sticky headers, fixed-width columns. |
false | false | Board-wide scroll with sticky headers, columns fill viewport. |
Per-column width
Set width on a column to give it a fixed outer width in pixels. It overrides both fixedColumnWidth modes for that column:
<script setup>
const columns = [
{ id: "backlog", label: "Backlog", width: 360 },
{ id: "doing", label: "In Progress" },
{ id: "done", label: "Done", width: 200 },
];
</script>
<template>
<Kanban :cards="cards" :columns="columns" />
</template>
Columns without width keep the default sizing. The board doesn't widen an explicit width to fit content. A collapsed column is still 40px wide. With swimlanes, lane cells use the same width as their column.
Card grid (PRO)
By default, cards in a column stack vertically, and each card is as tall as its content. Set cardWidth and cardHeight on a column to lay its cards out as a grid of fixed-size tiles instead:
<script setup>
import { Kanban } from "@svar-ui/vue-kanban";
import TileCard from "./TileCard.vue";
const columns = [
{ id: "backlog", label: "Backlog" },
{ id: "design", label: "Design", width: 480, cardWidth: 220, cardHeight: 140 },
{ id: "review", label: "Review", cardWidth: 160, cardHeight: 100 },
];
</script>
<template>
<Kanban :cards="cards" :columns="columns" :cardContent="TileCard" />
</template>

The grid fits as many cards per row as the column width allows, so a wider column shows more cards per row. If you set only one side, the other defaults to 220 (cardWidth) or 140 (cardHeight). Cards are clipped to their box, so make sure your card template fits the size. A compact cardContent component works best.
Grid columns work with both scroll modes, swimlanes, cardCss, and columnCss. In the MIT edition, the board ignores cardWidth and cardHeight, and every column uses the regular card stack.
Performance
For large boards, the render prop offers virtualization options that keep the DOM small while the store holds the full dataset.
Card virtualization
Set render.virtualizeCards to render only the cards visible in the scroll viewport, plus a configurable overscan buffer:
<template>
<Kanban
:cards="cards"
:columns="columns"
:render="{
virtualizeCards: true,
estimatedCardHeight: 96,
cardOverscan: 8,
}"
/>
</template>
estimatedCardHeight- height guess in pixels for unmeasured cards. Defaults to80.cardOverscan- extra cards rendered above and below the visible area. Defaults to5.
The board measures heights after the first render and caches them by card id. The cache survives reorder, filter, and sort. In flex-width mode, width changes invalidate the cache automatically so cards re-measure.
Column virtualization
Set render.virtualizeColumns to skip rendering card content for off-screen columns:
<template>
<Kanban
:cards="cards"
:columns="columns"
:render="{
virtualizeColumns: true,
columnOverscan: 1,
}"
/>
</template>
Column shells (headers, collapse state, summary tags, card list slots) stay in the DOM - the board skips only the card list inside off-screen columns. That keeps scroll geometry and drop-target lookup intact.
columnOverscan- extra columns rendered beyond the visible area on each side. Defaults to1.
Card and column virtualization are independent, so you can combine them.
Updating columns at runtime
Call api.exec("update-column", ...) to patch a column after the board mounts. Pass the column id and a partial object with the fields to change.
<script setup>
import { ref } from "vue";
import { Kanban } from "@svar-ui/vue-kanban";
const api = ref(null);
function renameColumn() {
api.value.exec("update-column", {
id: "doing",
column: { label: "Work in Progress" },
});
}
function collapseColumn() {
api.value.exec("update-column", {
id: "done",
column: { collapsed: true },
});
}
</script>
<template>
<Kanban ref="api" :cards="cards" :columns="columns" />
</template>
You can change any ColumnConfig field: label, css, summaries, menu, width, collapsed, addCard, custom keys, and so on.
Adding, removing, and reordering columns
Three more actions change the column list itself:
<script setup>
import { ref } from "vue";
import { Kanban } from "@svar-ui/vue-kanban";
const api = ref(null);
function addColumn() {
// inserts "Review" before "done"; omit `before` to append
api.value.exec("add-column", {
column: { id: "review", label: "Review" },
before: "done",
});
}
function moveColumn() {
// moves "backlog" to the end
api.value.exec("move-column", { id: "backlog" });
}
function deleteColumn() {
api.value.exec("delete-column", { id: "review" });
}
</script>
<template>
<Kanban ref="api" :cards="cards" :columns="columns" />
</template>
add-columninserts a column config. Without anid, the board generates one. The label defaults toString(id). Adding an existing id does nothing.delete-columnremoves the column config.move-columnplaces the column before thebeforecolumn, or at the end whenbeforeis omitted.
These actions change only the column configs. Cards stay untouched. Cards of a deleted column stay in the data but don't render until a column with that id comes back. All three actions also clear the undo/redo history.
For a ready-made UI to manage columns, see GroupManager (PRO).
Styling columns
Columns accept CSS classes in two ways: statically per definition or dynamically via a callback.
Static classes
Set css on a column definition to apply a class unconditionally:
<script setup>
const columns = [
{ id: "backlog", label: "Backlog", css: "column-muted" },
{ id: "doing", label: "In Progress" },
];
</script>
Dynamic classes
Pass columnCss to compute classes at render time based on a column's cards and state:
<template>
<Kanban
:cards="cards"
:columns="columns"
:columnCss="(items, column) => {
if (items.length === 0) return 'column-empty';
return '';
}"
/>
</template>
The first argument is the filtered and sorted card array of the styled element, and the second is the projected column view. On a regular board, that element is the whole column. With swimlanes, columnCss also styles each lane cell and gets only that cell's cards. In the stack layout, it styles each group and gets that group's cards. The board appends the returned string to the element's class list after any static css value and the built-in wx-collapsed modifier.
Built-in CSS classes
The board applies these classes automatically:
wx-column- always present on the column rootwx-collapsed- set when the column is collapsed
Target these in your stylesheet to customize column states.