dssoca docs
GitHub repository

Card

Titled panel container.

A bordered panel with an optional title (string or snippet), meta, description, and action slot, plus full-bleed `media` and a `footer` band. Becomes a link (`href`) or button (`onclick`) when interactive, with keyboard activation. `outlined` or `elevated` surface; the title renders at a configurable heading level for a correct document outline.

Demo

live · storybook Open in Storybook

Demo loads from https://dssoca-storybook.vercel.app/. Run pnpm storybook for it to render locally.

Usage

svelte
<script>
  import { Card } from 'dssoca';
</script>

<Card title="Services" meta="6 of 7 healthy"
  description="last sync 2m ago" variant="elevated">
  …content…
  {#snippet footer()}view all{/snippet}
</Card>

Props

PropTypeDefaultDescription
titlestring | SnippetHeading text, or a Snippet for inline icons/badges in the title.
metastringSecondary label rendered to the right of the title.
descriptionstringMuted description rendered under the heading.
actionSnippetHeader controls (buttons, menus) rendered to the right.
mediaSnippetFull-bleed visual above the head (zero side padding).
footerSnippetFooter band mirroring the head, rendered only when provided. Typically holds an action row (e.g. a secondary `ghost` + primary `Button`); the band is a `space-between` flex row, so wrap multiple actions in a single element to group (and left-align) them.
hrefstringMakes the whole card a primary link to this href.
onclick(e: MouseEvent | KeyboardEvent) => voidMakes the whole card clickable; pairs with keyboard activation.
variant'outlined' | 'elevated''outlined'Surface style (elevated uses shadow tokens).
titleLevelnumber3Heading level (aria-level) for the title.
size'sm' | 'md' | 'lg'Per-instance size override; inherits the ancestor `data-size-variant` when unset.
childrenSnippetRequired. Panel body.