What's new Report an issue
GIG Cymru NHS Wales, Digital Health and Care Wales

Stat card

One number with its name on it, so staff can see the size of something before opening it.

The default card

A label, a number, and at most one supporting line. No accent bar: the bar is emphasis, and a row where every card is emphasised has emphasised nothing. This is the card most screens want.

The grid is .sr-stat-cards, shipped with the component so it is written once rather than per screen.

Referrals

240

This month

Total casenotes

8

In all sites

Discharges

112

+10% on last month

<div class="sr-stat-cards">
  <div class="sr-stat-card">
    <p class="sr-stat-card__label">Referrals</p>
    <p class="sr-stat-card__value">240</p>
    <p class="sr-stat-card__support">
      <span class="sr-stat-card__delta sr-stat-card__delta--down">-5%</span> on last month
    </p>
    <span class="sr-stat-card__icon" aria-hidden="true"><!-- icon --></span>
  </div>
</div>

<!-- Add sr-stat-card--accent-primary for the left bar.
     Add sr-stat-card--value-first or sr-stat-card--inline to change the layout. -->

The accent bar, when one card leads

Add the bar to the card the screen is about โ€” the queue the user is here to clear, the figure the meeting is called over. One per row. Beside it, plain cards read as context rather than as competition.

Awaiting validation

18

Your queue

Total casenotes

8

In all sites

Discharges

112

This month

<div class="sr-stat-cards">
  <div class="sr-stat-card">
    <p class="sr-stat-card__label">Referrals</p>
    <p class="sr-stat-card__value">240</p>
    <p class="sr-stat-card__support">
      <span class="sr-stat-card__delta sr-stat-card__delta--down">-5%</span> on last month
    </p>
    <span class="sr-stat-card__icon" aria-hidden="true"><!-- icon --></span>
  </div>
</div>

<!-- Add sr-stat-card--accent-primary for the left bar.
     Add sr-stat-card--value-first or sr-stat-card--inline to change the layout. -->

Three layouts

Stacked is the default: the label names the number before you read it. Value first leads with the number, for a row scanned rather than read. Below, the same card in each. The icon holds its position: it belongs to the card, not to whichever line happens to come first, so a row mixing the two still has its icons on one line.

Referrals

240

This month

Referrals

240

<div class="sr-stat-cards">
  <div class="sr-stat-card">
    <p class="sr-stat-card__label">Referrals</p>
    <p class="sr-stat-card__value">240</p>
    <p class="sr-stat-card__support">
      <span class="sr-stat-card__delta sr-stat-card__delta--down">-5%</span> on last month
    </p>
    <span class="sr-stat-card__icon" aria-hidden="true"><!-- icon --></span>
  </div>
</div>

<!-- Add sr-stat-card--accent-primary for the left bar.
     Add sr-stat-card--value-first or sr-stat-card--inline to change the layout. -->

Inline is the short one, around 40px against the stacked card's hundred. For a strip above a table, a toolbar, or a phone screen where a full card takes the room the content needs. The number leads, there is no icon, and the cards size to their content and wrap.

All

502

Sent

318

Received

184

<div class="sr-stat-cards">
  <div class="sr-stat-card">
    <p class="sr-stat-card__label">Referrals</p>
    <p class="sr-stat-card__value">240</p>
    <p class="sr-stat-card__support">
      <span class="sr-stat-card__delta sr-stat-card__delta--down">-5%</span> on last month
    </p>
    <span class="sr-stat-card__icon" aria-hidden="true"><!-- icon --></span>
  </div>
</div>

<!-- Add sr-stat-card--accent-primary for the left bar.
     Add sr-stat-card--value-first or sr-stat-card--inline to change the layout. -->

The Figma set enumerates five types; three of them are the same layout with nothing, with a supporting line, and with a supporting line carrying a change. Whether there is a third line is a content decision, not a type of card, so pass the text or leave it out.

The accent bar is not a status

A 4px bar that turns amber, with nothing else changing, is meaning carried in colour alone โ€” which WCAG 2.2 SC 1.4.1 rules out. Use warning and critical only where the supporting line already names the problem in words. Here is the same row in greyscale: it still reads.

In transit

42

Pending receipt

Missing or escalated

24

Requires attention

<div class="sr-stat-cards">
  <div class="sr-stat-card">
    <p class="sr-stat-card__label">Referrals</p>
    <p class="sr-stat-card__value">240</p>
    <p class="sr-stat-card__support">
      <span class="sr-stat-card__delta sr-stat-card__delta--down">-5%</span> on last month
    </p>
    <span class="sr-stat-card__icon" aria-hidden="true"><!-- icon --></span>
  </div>
</div>

<!-- Add sr-stat-card--accent-primary for the left bar.
     Add sr-stat-card--value-first or sr-stat-card--inline to change the layout. -->

It is not a button

The card has no role, no handler, no hover and no focus ring, and it is not going to get them. If tapping the number should open the list behind it, put a Link under the card or build the whole tile as a Button โ€” then it is a button, with a button's focus ring and a button's accessible name. A div with a click handler is neither.

One number with its name on it, how many patients, how many casenotes, how many are late, so staff can see the size of something before opening it.


When to use

When not to use

How it works

, "Pending receipt", "Requires attention", and the card still reads correctly in greyscale, on a projector, and to someone who cannot separate the two.

Options

LayoutUse when
Stacked (default)The normal card. Label, value, optional supporting line
Value firstA row read as numbers rather than as sentences. The icon stays at the top
InlineTight space: a strip above a table, a toolbar, a phone screen. Around 40px against the stacked card's hundred, number first, no icon

Accent

AccentUse when
None (default)Almost always. The card is one reading among several
PrimaryOne card in a row leads, the queue the user came to clear, the figure the meeting is about
Warning ยท CriticalThat card needs attention, and the supporting line already names the problem in words

Do & don't

DoDon't
Name what the number counts, "Casenotes in transit"Label it with a system term, "CN_TRANSIT"
Keep the supporting line to one lineWrap a sentence under the number
Put the sign in the delta, "-5%"Rely on red and green to say which way it moved
Leave the accent off unless one card leadsPut a bar on every card in the row
Use one accent per meaning across a screenGive every card a different colour because the row looks flat
Reach for Inline where the space is tightShrink a stacked card to fit a toolbar
Round to what staff can act on, "1,240"Show a precision nobody uses, "1,240.00"
Say what the number is of, when it is not obvious, "In all sites"Leave the period unstated and let people assume today

Accessibility

Content

Clinical / DHCW notes

Related