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
Flat
No Padding
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
| Variant | What it is |
|---|---|
| default | Shadow (Sidebar, Rail) or border (Command, Dark). |
| flat | Always border, no shadow. |
| compact | 10px padding, Compact density. |
| no padding | For 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
| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | none | Heading, rendered as an h2 |
subtitle | ReactNode | none | Line under the title |
actions | ReactNode | none | Header actions (one primary at most) |
footer | ReactNode | none | Footer content |
flat | boolean | false | Border instead of shadow |
padding | CardPadding | 'default' | 'default' | 'compact' (10px) | 'none' (edge-to-edge tables) |
as | ElementType | 'section' | Root tag name |
children | ReactNode | — | 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>
| Kind | Name | Description |
|---|---|---|
| attribute | flat | Border instead of shadow; default false |
| attribute | padding | 'default' | 'compact' (10px) | 'none' (edge-to-edge tables); default 'default' |
| property / JSON attribute | as | Root tag name; default 'section' |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| slot | title | Heading, rendered as an h2; default none Plain text also works as the `title` attribute. |
| slot | subtitle | Line under the title; default none Plain text also works as the `subtitle` attribute. |
| slot | actions | Header actions (one primary at most); default none Plain text also works as the `actions` attribute. |
| slot | footer | Footer content; default none Plain text also works as the `footer` attribute. |
| slot | (default) | Card body. |