Skip to main content

getCardShape

Returns the default CardShape object. Use it as a base for the card prop to keep the standard sections and add or remove only a few.

Usage​

function getCardShape(): CardShape;

The returned shape enables these sections:

SectionDefault
prioritytrue
progresstrue
descriptiontrue
deadlinetrue
tagstrue

All other sections (cover, users, attachments, comments, menu) are absent (falsy) in the default shape.

menu: true renders the card ⋯ button. Wrap the board in CardActionMenu so the button opens a menu; without it, the button does nothing.

Example​

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

const api = ref();

const users = [
{ id: 1, label: "Alice", img: "/avatars/alice.png" },
{ id: 2, label: "Bob" },
];

const card = {
...getCardShape(),
users: { data: users },
menu: true,
};
</script>

<template>
<CardActionMenu :api="api">
<Kanban ref="api" :cards="cards" :columns="columns" :card="card" />
</CardActionMenu>
</template>
  • Cards guide - section visibility and per-section options
  • card - the CardShape prop on Kanban
  • getEditorItems - builds editor fields from the card shape