domestic-ui GitHub

Stat row

A row of headline numbers, each a small card with a label, the value and a note.

Our choice: A composition, not a component: a .grid of data-card articles, each a muted heading, a lead paragraph with the number in <strong> and a small note.

Where a stat row is used A row of small cards at the top of the content area, each with a label, a large number and a note.

Live example

Stat row

<section class="grid" aria-label="This month">
  <article data-card>
    <h3 data-text="small muted">Revenue</h3>
    <p data-text="lead"><strong>€45,231</strong></p>
    <p data-text="small muted">Up 20% on last month</p>
  </article>
  <article data-card>
    <h3 data-text="small muted">New customers</h3>
    <p data-text="lead"><strong>2,350</strong></p>
    <p data-text="small muted">Up 180 on last month</p>
  </article>
  <article data-card>
    <h3 data-text="small muted">Open orders</h3>
    <p data-text="lead"><strong>128</strong></p>
    <p data-text="small muted">12 due to ship today</p>
  </article>
  <article data-card>
    <h3 data-text="small muted">Refunds</h3>
    <p data-text="lead"><strong>€1,204</strong></p>
    <p><span data-badge="warning">3 waiting</span></p>
  </article>
</section>

Accessibility

  • Each stat is a card with its label as the heading, so screen reader users can move between stats by heading.
  • Write the change in words ("Up 20% on last month"), not only as a colour or an arrow (WCAG 1.4.1).
  • The row reflows from four columns to one without media queries; for a page of headed sections use the dashboard instead.

Specifications

See also

How other systems do it

For comparison only; these are not the standard this system follows.

Search