Stat
Displays a KPI with an optional icon, trend and supporting description.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
value | string | — | Plain-text metric. Use the value slot for formatted markup. |
label | string | — | Plain-text label. Use the label slot for formatted markup. |
tone | StatTone | neutral | Semantic colour applied to the icon container. |
Slots
| Name | Description |
|---|---|
value | Replaces the value text. |
label | Replaces the label text. |
icon | Icon shown in the tinted leading container. |
trend | Badge or short trend text shown beside the value. |
description | Supporting context below the label. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
container | The outer statistic layout container. |
icon | Container wrapping the assigned leading icon slot. |
value | Container wrapping the assigned primary value slot. |
trend | Container wrapping the assigned trend slot badge or text. |
label | Container wrapping the assigned statistic label slot. |
description | Container wrapping the assigned supporting description slot. |
CSS custom properties
Grouped by semantic target and state from --c2-component__target__state--property. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-stat--padding | padding | 16px | |
--c2-stat--gap | pixel | 12px | |
--c2-stat--background | color | #ffffff | |
--c2-stat--color | color | #18181b | |
--c2-stat--border | border | 1px solid #e4e4e7 | |
--c2-stat--border-radius | border-radius | 8px | |
--c2-stat--box-shadow | box-shadow | none | |
--c2-stat__icon--size | pixel | 40px | |
--c2-stat__icon--background | color | #f4f4f5 | |
--c2-stat__icon--color | color | #71717a | |
--c2-stat__icon--border-radius | border-radius | 8px | |
--c2-stat__icon__positive--background | color | #dcfce7 | |
--c2-stat__icon__positive--color | color | #15803d | |
--c2-stat__icon__negative--background | color | #fee2e2 | |
--c2-stat__icon__negative--color | color | #b91c1c | |
--c2-stat__icon__warning--background | color | #fef3c7 | |
--c2-stat__icon__warning--color | color | #a16207 | |
--c2-stat__value--font-size | font-size | 24px | |
--c2-stat__value--font-weight | font-weight | 600 | |
--c2-stat__value--line-height | pixel | 32px | |
--c2-stat__label--font-size | font-size | 14px | |
--c2-stat__label--color | color | #71717a | |
--c2-stat__description--font-size | font-size | 12px | |
--c2-stat__description--color | color | #71717a | |