You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A themeable, accessible metric display component for presenting a label, value, and contextual hint. Supports semantic variants, size/emphasis/alignment options, trend indication, named slots, and a loading state.
Custom value content (overrides value attribute text)
hint
Custom hint content (overrides hint attribute text)
(default)
Additional content appended to the body
<x-statvariant="positive" trend="up"><spanslot="icon" aria-hidden="true">↗</span><spanslot="label">Monthly recurring revenue</span><spanslot="value">$84,920</span><spanslot="hint">Up 11.4% from last month</span></x-stat>
Parts
Part
Description
base
Outer grid wrapper
icon
Icon area containing the icon slot
body
Body area containing label, value, hint, and default slot
label
Label row (contains label slot + text span)
value
Value row (contains value slot + text span)
hint
Hint row (contains hint slot + text span)
CSS Custom Properties
Layout
Variable
Default
Description
--x-stat-background
transparent
Background colour
--x-stat-color
inherit
Base text colour
--x-stat-muted-color
rgba(0,0,0,0.55)
Muted text colour (label, hint)
--x-stat-border-color
transparent
Border colour
--x-stat-radius
12px
Border radius
--x-stat-padding
16px
Padding
--x-stat-gap
6px
Grid gap
Typography
Variable
Default
Description
--x-stat-label-color
muted-color
Label text colour
--x-stat-label-size
12px
Label font size
--x-stat-value-color
color
Value text colour
--x-stat-value-size
20px
Value font size
--x-stat-hint-color
muted-color
Hint text colour
--x-stat-hint-size
12px
Hint font size
--x-stat-icon-color
color
Icon colour
Semantic colour tokens
Variable
Default (light)
Description
--x-stat-positive-color
#16a34a
Positive variant value colour
--x-stat-warning-color
#d97706
Warning variant value colour
--x-stat-danger-color
#dc2626
Danger variant value colour
Dark-mode variants are set automatically via @media (prefers-color-scheme: dark).
<x-statvariant="positive" trend="up"><spanslot="icon" aria-hidden="true">↗</span><spanslot="label">Monthly recurring revenue</span><spanslot="value">$84,920</span><spanslot="hint">Up 11.4% from last month</span></x-stat>