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:
| Section | Default |
|---|---|
priority | true |
progress | true |
description | true |
deadline | true |
tags | true |
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>
);
}
Related
- Cards guide - section visibility and per-section options
- card - the CardShape prop on Kanban
- getEditorItems - builds editor fields from the card shape