4.2.0
Patterns

EntityCard

One row of a vertical roster — who or what it is, a few counts, how it is doing, and a way in. The whole card is the target, and it can still hold its own controls.

Default

The row a vertical roster settles into: a leading `Avatar`, the name with the chip that qualifies it, a meta line of counts, and health on the trailing edge. The whole card is the target — the hit area belongs to `EntityCardTitle` and is stretched to the card's edges — so the link is still announced by its own name rather than by the row's entire text. The chevron is drawn by the card itself, only because an activator is present. `EntityCard` takes no `asChild`, so the list semantics stay the caller's: the `li` is yours.

Usage

import {
  EntityCard,
  EntityCardActions,
  EntityCardContent,
  EntityCardHeading,
  EntityCardMedia,
  EntityCardMeta,
  EntityCardMeter,
  EntityCardTimestamp,
  EntityCardTitle,
  EntityCardTrailing,
} from '@oceanic-hub/brand-system'
<EntityCard>
  <EntityCardMedia>…</EntityCardMedia>
  <EntityCardContent>
    <EntityCardHeading>
      <EntityCardTitle>…</EntityCardTitle>
    </EntityCardHeading>
    <EntityCardMeta>
      <EntityCardTimestamp>…</EntityCardTimestamp>
    </EntityCardMeta>
  </EntityCardContent>
  <EntityCardTrailing>…</EntityCardTrailing>
</EntityCard>

Composition

Use the following composition to build an EntityCard:

EntityCard
├── EntityCardMedia
├── EntityCardContent
│   ├── EntityCardHeading
│   │   └── EntityCardTitle
│   └── EntityCardMeta
│       ├── EntityCardTimestamp
│       └── EntityCardMeter
├── EntityCardTrailing
└── EntityCardActions

Ten parts rather than a prop bag, for Item's and ApprovalCard's reason: a roster row is a small document, and every part of it is somebody's node. A badge, an avatar and a status prop would each decide, for every caller forever, that the thing in that slot cannot be a tooltip trigger, a link, or two chips instead of one.

Why this and not Item asChild. Item already draws the same media/content/actions grammar and already takes asChild, so the honest question is why it is not the answer. Making a row navigable that way puts the whole body inside the anchor, and that costs two things no call site can buy back. An anchor may have no interactive descendant, so the per-row overflow menu these surfaces keep INSIDE the row has nowhere legal to go; and everything in the anchor becomes its accessible name, so a screen reader announces one link called "Northwind Partners Enterprise 5 teams 22 sends 1,727/2,800 Healthy 6 to review". So activation moves off the region and onto the name: EntityCardTitle is the control, its hit area is stretched to the card's edges, and EntityCardActions stacks above that overlay as a sibling of the link. The card is clickable edge to edge, the link is named by its own text, and an inner button is legal HTML.

The title has three renderings and one prop pair. href gives an anchor; asChild gives the caller's own element — a framework link so the row does not hard-navigate, or a button for a card that acts rather than navigates; neither gives a plain span. That third one is a real state, not a fallback: an archived record, or a reader with no permission on the row, must not be handed a control that looks live.

The chevron is derived, never passed. The card draws it only when it contains an activator, resolved from the activator's own presence. There is no chevron prop and no hideChevron, because a prop lets the indicator and the affordance disagree in both directions — a chevron on a row that cannot be entered advertises an affordance the reader does not have, and a navigable row without one hides the only cue that the whole card is a target.

It paints no status colour. Health arrives as a node in EntityCardTrailing, because StatusPill already owns the three axes, their labels and their tones; a status prop here would freeze the choice of axis into this component's semver. Elevation is the hairline border, so the row reads as a surface without a shadow. The one place tone does live is EntityCardMeter, which is a meter — one of the three places the status doctrine puts colour. Its tone is the caller's already-computed state; it re-derives no threshold, so a bar can never disagree with the figure another surface is showing. Its children are the formatted figures and they are REQUIRED, because they are the bar's accessible name rather than decoration beside it.

Reach for Item instead for a plain list row — one with no per-row controls, or one that is not navigable at all; it is lighter and it is the core primitive. Reach for DataTable as soon as the reader compares rows against each other, which is what columns are for. This is the case in between: each row is an identity the reader recognises and enters.

With controls inside the card

The reason this is a module and not Item with a longer class list. EntityCardActions is a SIBLING of the link, so a real button lives inside a card that is itself clickable — legal HTML, where Item asChild with an anchor can have no button descendant at all. It is positioned, so it stacks above the title's stretched overlay: clicking a control does not activate the card, and the card still activates everywhere else. Tab through it — the card takes focus first and outlines whole, then each control in turn.

NP
$1,727 / $2,800
5 teams
Healthy

A row that cannot be entered

Give EntityCardTitle neither href nor asChild and it renders a plain span. That is a real state — an archived record, or a reader with no permission on the row — and the whole affordance goes with it: no hover wash, no focus ring, and no chevron, because the card derives the indicator from the activator's presence rather than from a prop. Compare the two cards below: nothing but the title's props differs.

NP
5 teams
Healthy
HI
Halyard Industrial SupplyArchived
1 team
At risk

API Reference

See the EntityCard API page for every prop of every part, with types, defaults and the contract that pins them.

On this page