InstallComponentsExample

Stat

A headline number with a label, unit and change badge.

How it helpsTabular figures keep rows of numbers aligned. Add data-tone to colour the number.

KPI row

Billable hours3,412h↗ 6.1%
26-week total1,516 tasks
Utilization82%
export default function Example() {
  return (
    <>
      <div className="grid grid-cols-1 gap-3 sm:grid-cols-3 w-full">
        <div className="card stat"><small>Billable hours</small><strong>3,412<small>h</small></strong><span className="badge justify-self-start">↗ 6.1%</span></div>
        <div className="card stat" style={{ "--tone": "var(--sd-accent)" }}><small>26-week total</small><strong>1,516 <small>tasks</small></strong></div>
        <div className="card stat"><small>Utilization</small><strong>82<small>%</small></strong></div>
      </div>
    </>
  );
}
<div class="grid grid-cols-1 gap-3 sm:grid-cols-3 w-full">
  <div class="card stat"><small>Billable hours</small><strong>3,412<small>h</small></strong><span class="badge justify-self-start">↗ 6.1%</span></div>
  <div class="card stat" style="--tone:var(--sd-accent)"><small>26-week total</small><strong>1,516 <small>tasks</small></strong></div>
  <div class="card stat"><small>Utilization</small><strong>82<small>%</small></strong></div>
</div>

API

NameTypeDescription
.statclassCombine with .card for a tile.
> smalltagLabel.
> strong > smalltagValue and unit.
data-tone / --tonecolourNumber colour.