Components · Structure

Card

A bounded region holding things that belong together. In a patient record, a boundary is a claim — it asserts that everything inside relates to one subject, from one source, at one time. Draw one carelessly and you have made a clinical statement by accident.

Stable · v1.0 shadcn/ui WCAG 2.2 AA

Overview

Cards are the least interesting component in most design systems and one of the more consequential here, because grouping carries meaning. A clinician reading a card containing a troponin value and an ECG finding will reasonably infer that both belong to the same patient, the same encounter and roughly the same moment. If any of that is untrue, the card said so and nobody wrote it down.

Truthful grouping

Everything inside one card shares a subject, a source and a time. If those differ, it is two cards.

Flat

One level of nesting, never two. A card inside a card inside a panel is a hierarchy nobody can hold while being interrupted.

Complete

A card shows all of its content or says how much it is hiding. Nothing clinical scrolls silently inside a fixed-height box.

Anatomy

Card · header, body, footer

High-sensitivity troponin I

Rising
47 ng/L
14 → 47 ng/L over the 0/1 h interval · ref < 34 ng/L

NSTEMI cannot be excluded on this trajectory. Repeat sampling due 15:10.

OKONKWO, B. · MRN 51 330 264 · drawn 14:41 · Central lab
RegionContainsRule
HeaderTitle, optional status chip A real heading element at the correct level. The title names the subject, not the widget — "High-sensitivity troponin I", not "Lab panel".
BodyThe content One subject. Values carry units. Nothing scrolls without a visible affordance.
FooterProvenance Patient, time and source. Required on any card holding clinical data — this is the line that makes the grouping checkable rather than assumed.
Provenance is what makes a boundary honest

A card asserts that its contents belong together. The footer is where that assertion is made explicit and falsifiable: whose data, from when, from where. A clinical card without provenance is a grouping claim with nothing behind it — and it is exactly the construct that lets data from a previous encounter, or a different patient, sit unnoticed beside current results.

What may share a card

TogetherSeparate
Serial values of the same measurement in one encounter The same measurement from a previous admission
Findings from one ECG acquisition Findings from two acquisitions — even minutes apart
A model output and the confidence and version that produced it Outputs from two model versions
Fields a clinician fills in one action Fields that submit to different systems

Where a genuine comparison across sources is needed — a current ECG against a prior — that is two cards side by side, each with its own provenance, never one card with two halves. See ECG review.

Variants

default

Bordered, on --card. The workhorse.

interactive

The whole card is one link or button leading to detail. Border strengthens on hover, focus ring on the card itself. Only permitted when the card contains no other interactive element — nested controls inside a clickable card produce a target a clinician cannot aim at and a nesting violation assistive technology cannot resolve.

flush

Body padding removed so a table or trace can meet the card edge. Used by Data grid and ECG review.

Border, not shadow

Cards are separated by a 1 px border, not a drop shadow. Shadow means "floating above, and probably temporary" — it belongs to popovers, menus and dialogs. Using it for static content teaches clinicians that raised things are transient, which then undermines the components where transience is the point. A card that needs a shadow to be found is a card on the wrong surface.

Nesting and density

Do

12-lead ECG

Anterior ST elevation 3.1 mm.
HARLAND, A. · acquired 14:26:38 · Bay 4 cart

One acquisition, one subject, provenance stated. The grouping can be checked.

Don't

Cardiac summary

Anterior ST elevation 3.1 mm.
Troponin 47 ng/L.
Prior ECG: normal.

Three sources, three times, no provenance. The card asserts they belong together and gives no way to check whether they do.

Do's and don'ts

Do

12-lead ECG

Anterior ST elevation 3.1 mm.
HARLAND, A. · acquired 14:26:38 · Bay 4 cart

One acquisition, one subject, provenance stated. The grouping claim can be checked.

Don't

Cardiac summary

Anterior ST elevation 3.1 mm.
Troponin 47 ng/L.
Prior ECG: normal.

Three sources, three times, no provenance. The boundary asserts a relationship nobody can verify.

Do

Troponin

Rising
47 ng/L

Flat card; urgency carried by the chip, where a clinician already looks for it.

Don't

Troponin

47 ng/L

Raised to signal importance. It now reads as floating and dismissible, competing with the alarm layer.

Accessibility

Outcomes of use

What this contributes to, in the terms of Usability & context of use. These are attributes believed to contribute to an outcome; the outcome itself is settled by observing real use in a specified context, not by this page.

Clinical safety notes

Risk controls carried by this component

Trace these in your risk file (ISO 14971) and usability engineering file (IEC 62366-1).

Implementation

$ npx shadcn@latest add https://md.notjustany.tech/r/card.json
<Card variant="default">
  <CardHeader>
    <CardTitle as="h3">High-sensitivity troponin I</CardTitle>
    <StatusChip status="urgent" alarmRef={alarm.id}>Rising</StatusChip>
  </CardHeader>

  <CardBody>
    <Measurement value={47} unit="ng/L" reference="< 34 ng/L" />
  </CardBody>

  // Required for any card holding clinical data. Rendering CardBody with
  // clinical content and no CardProvenance fails lint.
  <CardProvenance
    subjectId="51330264"
    observedAt="2026-08-13T14:41:00Z"
    source="Central lab"
  />
</Card>
PropTypeDefaultNotes
variantdefault | interactive | flush default interactive throws if any focusable descendant is present.
as (title)h2 | h3 | h4h3 Set to match the surrounding heading structure. Never skipped.
subjectIdstring Required on clinical cards, via CardProvenance.
observedAt · sourcestring Required alongside subjectId.
maxHeightnumber Ignored for clinical content; warns in development.
NotJustAnyMed.Tech Design System · Card · v1.0 · draft for review
Reference applications named in this system are fictional; all patient data shown is fabricated. Reference ranges are illustrative, not clinical guidance.