Skip to content

Stat ​

SStat is the metric tile of a dashboard: a label, the number it stands for, an optional change against a previous period and a line of context. The label is required — a number with no name tells a reader nothing — and it is also the accessible name of the tile: value and label are wrapped in one labelled group, so a screen reader reads "Revenue, 1,234,567" instead of two unrelated strings.

The trend is never conveyed by color and an arrow alone. Next to the change the component renders a visually hidden direction label (Up / Down, from the locale dictionary, overridable with trend-up-label / trend-down-label); a zero change stays neutral and gets no label, because a plain 0 already reads as no movement.

By default the tile draws no surface of its own: it is meant to sit inside an SCard or in a grid cell that already has one. variant="card" gives it a standalone look with a border, a radius and padding.

Basic usage ​

A numeric value is formatted with the thousands separators of the current locale. Tiles line up in a grid; icon marks the metric, description carries the period or the source.

Revenue
1,234,567
Last 30 days
Active users
8,421
Last 30 days
Conversion
12.5%
Checkout funnel

A string value is rendered exactly as given — use it for numbers that are already formatted (12.5%, $1.2M). format-value controls the rest: false prints the raw number, an object is passed to Intl.NumberFormat as its options.

Order id
1234567
Revenue
$1,234.50
Storage
73.2%

trend is the signed change: positive renders the upward treatment, negative the downward one, 0 the neutral one. trend-label says what the change is measured against.

Revenue
1,234,567
Up+12.4vs last month
Refunds
312
Down-3.2vs last month
Open tickets
48
0vs last month

Card variant and sizes ​

variant="card" turns the tile into a standalone card; square removes its radius. size scales the value, the spacing and the icon, and color accents the icon with a name from the palette.

Sessions
24,318
Revenue
1,234,567
Up+12.4vs last month
Active users
8,421

A plain tile keeps its own layout inside a card, so several metrics can share one surface.

Revenue
1,234,567
Up+12.4vs last month
Orders
4,821
Down-1.8vs last month

Loading ​

While the data is in flight, loading replaces the value and the label with skeletons, hides the trend and the description, and marks the tile aria-busy.

Slots ​

value, label, icon, trend and description replace the matching parts; actions puts a control in the corner of the tile, next to the label.

Revenue
1.23 M
Up+12.4
Updated a minute ago

API ​

Props

NameTypeDefaultDescription
label*stringrequiredWhat the number means (Revenue, Active users). Required: a value without a name tells a reader nothing, and it is the accessible name of the tile.
value*string | numberrequiredThe metric itself. A number goes through Intl.NumberFormat (see formatValue); a string is rendered as given, for values that are already formatted ($12.5K, 99.9%).
descriptionstringundefinedExplanatory line under the value: the period, the source, a comparison.
iconstringundefinedIcon next to the label: a registry name (users, credit-card, …) or a raw SVG path. Decorative — the meaning is carried by the label.
trendnumberundefinedSigned change of the metric: a positive number renders the upward treatment, a negative one the downward treatment, 0 the neutral one. The direction is announced with a hidden label, so it is not conveyed by the color and the arrow alone.
trend-labelstringundefinedText next to the trend: what the change is measured against (vs last month).
trend-up-labelstringundefinedHidden label of an upward trend; by default it comes from the locale dictionary.
trend-down-labelstringundefinedHidden label of a downward trend; by default it comes from the locale dictionary.
format-value | false | true | Intl.NumberFormatOptionstrueFormatting of a numeric value: true adds the thousands separators of the current locale, false prints the number as is, and an object is passed to Intl.NumberFormat as its options ({ style: 'currency', currency: 'USD' }). A string value is never formatted; the trend keeps its sign in every case.
localestringundefinedFormatting locale (for example en-GB). Derived from the library locale by default (ConfigProvider/installLocale, in Nuxt the locale option): en → en-US.
colorstringundefinedAccent color of the icon: a name from the palette (primary/teal).
size"md" | "sm" | "lg""md"Size: scales the value, the spacing and the icon.
variant"plain" | "card""plain"Surface: plain is bare text meant to sit inside an [SCard](./card) or a grid, card gives the tile its own surface, border and padding.
squarebooleanfalseSquare corners of the card variant: removes the border radius.
loadingbooleanfalseThe data is still loading: the value and the label are replaced with skeletons and the tile is marked aria-busy.

Slots

NameDescription
valueThe value itself: replaces the formatted number.
labelWhat the number means: replaces the label prop.
iconMedia next to the label: replaces the icon.
trendThe whole trend line: the arrow, the change and its hidden direction label.
descriptionExplanatory line under the value: replaces the description prop.
actionsActions in the corner of the tile: a link to the report, a period switch.