Stat
A single metric: a prominent value with its label, optional trend delta, and caption.
Live demo
Stat presents one figure at a glance: a large value (the default slot) under a small uppercase label, with an optional delta carrying a trend (up / down / flat) and an optional caption for context. The value and delta render in tabular figures so columns of stats align digit-for-digit.
The trend tints the delta (success for up, danger for down, neutral for flat) and pairs the color with a directional arrow so meaning never rides on color alone. Pure presentation: compose several in a Grid or Cluster for a dashboard strip, or drop one into a Card header.
When to use
How this component composes with the rest of the set.
Props
7 props, straight from the manifest.
| Prop | Type | Default | Bindings | Description |
|---|---|---|---|---|
Appearance
Sizes
sm
Compact value.
md
Default.
lg
Large display value.
Anatomy
The named parts that make up the component, with their selectors.
stat
The flex-column root carrying the alignment and size classes.
label
The metric name: small, uppercase, and muted, rendered above the value via flex order.
value
The headline figure: display font, bold, tabular, in the primary ink.
delta
The optional change indicator with a directional arrow, tinted by trend.
caption
An optional subtle line of context below the value.
Tokens & coverage
What the component consumes, checked live against what the algorithm produces.
Live coverage check against the xoji-default register
(derive(xojiDefault, { anchors }) →
coverComponent(manifest, register)). Every token this component
consumes must be a key the algorithm produces.
--danger-vivid
--fg-0
--fg-2
--fg-3
--font-display
--font-sans
--leading-normal
--leading-tight
--neutral-text
--neutral-vivid
--space-1
--space-2
--success-vivid
--text-2xl
--text-3xl
--text-sm
--text-xl
--text-xs
--weight-bold
--weight-semibold
Slots
The metric value.
Accessibility
Code
Metrics, trends, and sizes
A value under its label, with optional trend deltas and captions, across the three sizes and both alignments — plus the inline ticker layout that lays label, value, and delta on one line.
<xoji-stat label="Monthly revenue" delta="+12.5%" trend="up" caption="vs. last month">$48,250</xoji-stat>
<xoji-stat label="Active themes" delta="-3" trend="down">1,204</xoji-stat>
<xoji-stat label="Token coverage" size="lg" align="center">57 / 57</xoji-stat>
<xoji-stat label="components" delta="+1" trend="up" inline>49</xoji-stat>
<script lang="ts">
import { Stat } from "@xoji/svelte";
</script>
<Stat label="Monthly revenue" delta="+12.5%" trend="up" caption="vs. last month">$48,250</Stat>
<Stat label="Active themes" delta="-3" trend="down">1,204</Stat>
<Stat label="Token coverage" size="lg" align="center">57 / 57</Stat>
<Stat label="components" delta="+1" trend="up" inline>49</Stat>
---
import { Stat } from "@xoji/astro";
---
<Stat label="Monthly revenue" delta="+12.5%" trend="up" caption="vs. last month">$48,250</Stat>
<Stat label="Active themes" delta="-3" trend="down">1,204</Stat>
<Stat label="Token coverage" size="lg" align="center">57 / 57</Stat>
<Stat label="components" delta="+1" trend="up" inline>49</Stat>