Skip to main content

Card

BasicData display<co-card>

Card is the white container every screen section sits in, with an optional title, actions and footer.

import { Card } from 'health-components';

Examples​

Showcase​

Storybook

Flat​

Storybook

No Padding​

Storybook

Usage​

<Card title="Coverage" subtitle="Verified 10/08/2026" actions={<Button size="sm">Recheck</Button>}>
<DescriptionList items={[["Payer", "Aetna PPO"]]} />
</Card>

When to use​

  • Group one topic: Allergies, Claim lines, Coverage.

When not to use​

  • Nesting a card in a card: use a divider or a DescriptionList.

Variants and states​

VariantWhat it is
defaultShadow (Sidebar, Rail) or border (Command, Dark).
flatAlways border, no shadow.
compact10px padding, Compact density.
no paddingFor tables that run edge to edge.

Accessibility​

  • The title is an h2, so cards build the page outline.

Do and don't​

  • Do: One primary action in the card header at most.
  • Don't: Coloured left borders as decoration.

Props​

PropTypeDefaultDescription
titleReactNodenoneHeading, rendered as an h2
subtitleReactNodenoneLine under the title
actionsReactNodenoneHeader actions (one primary at most)
footerReactNodenoneFooter content
flatbooleanfalseBorder instead of shadow
paddingCardPadding'default''default' | 'compact' (10px) | 'none' (edge-to-edge tables)
asElementType'section'Root tag name
childrenReactNode—Card body.

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-card>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-card flat padding="…" [as]="as">…</co-card>
KindNameDescription
attributeflatBorder instead of shadow; default false
attributepadding'default' | 'compact' (10px) | 'none' (edge-to-edge tables); default 'default'
property / JSON attributeasRoot tag name; default 'section'
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
slottitleHeading, rendered as an h2; default none Plain text also works as the `title` attribute.
slotsubtitleLine under the title; default none Plain text also works as the `subtitle` attribute.
slotactionsHeader actions (one primary at most); default none Plain text also works as the `actions` attribute.
slotfooterFooter content; default none Plain text also works as the `footer` attribute.
slot(default)Card body.