Stat card

A labeled statistic with a unit, timeframe and a trend direction expressed in text.

A server action cycles through fixed request counts in this visitor's island.

Open in new tab

Each preview is its own Live page in a frame, because this site is a Vue 3.5 app built on the Pulsar starter kit. An open list or popover stays inside its frame; in your application it opens over the page.

Installation

bash
suprnova live:add stat-card

Usage

html
{% import "suprnova-ui/stat-card/stat-card.html" as stat_card %}
{% call stat_card::stat_card("requests", "Requests", "1200", unit="requests") %}{% endcall %}

Examples

Trend directions

Up, down and flat trends name their direction in text.

Open in new tab

Keyboard and accessibility

suprnova.stat-card - one labeled statistic (DATA-002). The value is a data element; the trend names its direction in text before the delta, so the direction never rests on color or an arrow.

API reference

stat_card

ParameterDefaultDescription
idRequiredThe unique statistic id, also used for its label.
labelRequiredThe name of the statistic.
valueRequiredThe statistic value, also written into the native data element.
unit""An optional unit shown beside the value.
trend"flat"The direction: up, down or flat, also written as visible text.
delta""The change amount; empty omits the trend row.
timeframe""An optional period shown after a nonempty delta.