Skip to main content

cardContent

Replaces the built-in card template with a custom Svelte snippet. The wrapper element (selection state, drag affordances, data-id, CSS classes) stays intact - only the content inside it changes.

Usage

cardContent?: Component<{ card: KanbanCard; cardShape: CardShape }>;

The snippet receives two props:

FieldTypeDescription
cardKanbanCardThe source card data object
cardShapeCardShapeThe current section visibility map from card

Example

<Kanban {cards} {columns}>
{#snippet cardContent({ card, cardShape })}
<div class="my-card">
<strong>{card.label}</strong>

{#if card.owner}
<span>{card.owner}</span>
{/if}
</div>
{/snippet}
</Kanban>
  • Cards guide — card data shape and custom card body
  • card — CardShape controlling section visibility
  • cardCss — per-card CSS classes