Skip to main content

cards

Array of card objects displayed on the board. Each card must have an id - the store throws "Kanban cards must have an id" when a card comes without one. All other fields are free-form and passed through to renderers, the editor, filters, and sort comparators.

A deadline value must be a Date object. Strings and timestamps aren't parsed, so convert them when loading the data. RestDataProvider converts them automatically.

columnAccessor sets which column a card belongs to (defaults to the column field).

Usage​

cards: KanbanCard[];

type CardID = string | number;

interface KanbanCard {
id: CardID; // required
[key: string]: any;
}
FieldTypeDescription
idCardID (string | number)Required. Unique card identifier
[key: string]anyAny additional fields - label, description, priority, progress, deadline (Date), tags, users, attachments, comments, css, etc.

Example​

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

const columns = [
{ id: "backlog", label: "Backlog" },
{ id: "done", label: "Done" },
];

const cards = [
{ id: 1, label: "Fix login bug", column: "backlog", priority: 3 },
{ id: 2, label: "Write tests", column: "done", priority: 1 },
];
</script>

<template>
<Kanban :cards="cards" :columns="columns" />
</template>
  • Cards guide - card data shape, sections, custom templates, and card actions
  • columns - the column definitions that cards are distributed across
  • columnAccessor - controls how cards map to columns
  • add-card - add new cards to the board