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.
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
suprnova live:add stat-cardUsage
{% 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.
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
| Parameter | Default | Description |
|---|---|---|
id | Required | The unique statistic id, also used for its label. |
label | Required | The name of the statistic. |
value | Required | The 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. |
