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​

import { useState } from "react";
import { Kanban, CardActionMenu, getCardShape } from "@svar-ui/react-kanban";

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

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

export default function App() {
const [api, setApi] = useState();

return (
<CardActionMenu api={api}>
<Kanban init={setApi} cards={cards} columns={columns} card={card} />
</CardActionMenu>
);
}
  • Cards guide - section visibility and per-section options
  • card - the CardShape prop on Kanban
  • getEditorItems - builds editor fields from the card shape