Components
Stat tile
Big numbers in the display face, with a plain label.
Example#
5Live sites
3Languages
100%AA contrast by test
<div class="ha-stat-grid" style="width:100%">
<div class="ha-stat"><span class="ha-stat__value">5</span><span class="ha-stat__label">Live sites</span></div>
<div class="ha-stat"><span class="ha-stat__value">3</span><span class="ha-stat__label">Languages</span></div>
<div class="ha-stat"><span class="ha-stat__value">100%</span><span class="ha-stat__label">AA contrast by test</span></div>
</div>The numeral uses --ha-font-display, which is Saira Condensed in the Origin brand and falls back to Inter. The grid is one column on phones and three from 640px. The number uses accent-text so it passes AA.
| Class | Purpose |
|---|---|
ha-stat-grid | Responsive grid. |
ha-stat, __value, __label | The tile and its parts. |
Accessibility#
- Pair every number with a label that makes sense alone.
- If the numeral counts up, set the final value in the HTML and respect reduced motion.