Clinia UI

Card

Groups the content and actions about one thing, such as a plan or a source.

shadcn docs →

When to use

  • Group the content and actions about one thing: a workspace, a source, a plan.
  • Show options side by side, with one of them selected.

When not to use

  • A row in a list of similar things: use Item.
  • Rows and columns of data: use Table.
  • A message about the state of the page: use Alert.

Install

npx shadcn@latest add @clinia/card
Patient summary
Last updated 2 hours ago

Jane Cooper, 42. Stable vitals, follow-up scheduled for next Tuesday.

Marketing (Sera)

Patient summary
Last updated 2 hours ago

Jane Cooper, 42. Stable vitals, follow-up scheduled for next Tuesday.

Anatomy

Montreal clinic
3 sources

Synced today.

  1. 1Container[data-part=card]bg-card · border-border · rounded-lg
  2. 2Header: title and description[data-part=header]text-lg · text-muted-foreground
  3. 3Content[data-part=content]p-6 pt-0
  4. 4Footer[data-part=footer]gap-3 · p-6 pt-0

Clinia rules

  • default is the border hairline. It is decorative, so it never carries meaning on its own.
  • emphasis is a Trust border (at least 3:1 in both themes) for the selected or featured card. Keep one per group.
  • interactive is for a card that is itself the link or button: its edge darkens to border-input on hover, and focus shows the Trust ring.
  • Don't nest cards. Split the content inside one card with Separator or spacing.
  • Card has no padding of its own: CardHeader, CardContent and CardFooter carry it. Put content in those parts, or pad a custom child yourself.

Do and don't

Québec clinic
2 sources
Montreal clinic
3 sources
Do mark the one selected card with the emphasis border.
Québec clinic
2 sources
Montreal clinic
3 sources
Don't give every card in a group the emphasis border.
Montreal clinic

3 sources

12 clinicians

Do split content inside one card with a separator.
Montreal clinic
3 sources
12 clinicians
Don't nest cards inside a card.

States: product (Luma)

default
Starter
Up to 10,000 indexed records.
emphasis · selected or featured
Team
Up to 10,000 indexed records.
interactive
Open workspace
Up to 10,000 indexed records.
interactive · hover
Open workspace
Up to 10,000 indexed records.
interactive · focus
Open workspace
Up to 10,000 indexed records.
render · article
One identity per provider
Duplicate records merge into one.

Focus cells apply the component's focus-visible classes statically. Toggle the site theme to review both themes.

States: marketing (Sera)

default
Starter
Up to 10,000 indexed records.
emphasis · selected or featured
Team
Up to 10,000 indexed records.
interactive
Open workspace
Up to 10,000 indexed records.
interactive · hover
Open workspace
Up to 10,000 indexed records.
interactive · focus
Open workspace
Up to 10,000 indexed records.
render · article
One identity per provider
Duplicate records merge into one.

Focus cells apply the component's focus-visible classes statically. Toggle the site theme to review both themes.

Accessibility

Built in

  • The default hairline is decorative. The emphasis border is Trust, which clears 3:1 on the page and on cards in both themes.
  • variant="interactive" is for a card that is itself a link or button. Card renders a div by default, so the focus ring only shows once it renders a link or you make it focusable (see Your responsibility).

Your responsibility

  • CardTitle renders a div. Put a heading inside it, such as <h3>, so screen reader users can jump from card to card.
  • A selected card needs a state a screen reader can hear, such as a checked radio button inside it. The border alone says nothing.
  • Render an interactive card as its link: render={<Link href="…" />}. Otherwise give it role, tabIndex={0} and Enter handling.
  • A card that stands on its own, such as a feature card on a marketing page, can keep its <article> role: pass render={<article />}.

How to test

  1. Toggle the site theme: the emphasis border stays visible on the page in both.
  2. With a screen reader, list the headings: each card's title is there.
  3. On an interactive card, press Tab: the Trust ring appears, and Enter opens it.

API

PropValuesDefaultDescription
render
React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>
–

The element to render, such as <article /> for a card that stands on its own, or <Link href="…" /> for an interactive card. Defaults to a div.

variant
defaultemphasisinteractive
default
  • default Hairline border edge.
  • emphasis border-emphasis edge: a selected option or a featured card. One per group.
  • interactive A card that is itself a link or button: the edge darkens on hover.

All other props come from the native div element.