Stat
A figure with a trend read as words.
JavaScript off: what the HTML and CSS do on their own.
A key figure: a label, a large value, and optionally how it changed and a note. No script.
Usage
<Stat Label="Revenue" Value="$48,210" Change="12%" Trend="StatTrend.Up" Description="vs last month" />Trends
Use Trend and Change for how the figure moved; ChangeStatus colors a drop that's good news.
Preview
- Revenue
- $48,210
- Active users
- 2,340
- Response time
- 182 ms
Code
<Grid Columns="new() { Base = 1, Sm = 3 }" Gap="4" Grow>
<Card><Stat Label="Revenue" Value="$48,210" Change="12%" Trend="StatTrend.Up" Description="vs last month" Icon="Lucide.DollarSign" /></Card>
<Card><Stat Label="Active users" Value="2,340" Change="3.1%" Trend="StatTrend.Down" Description="vs last week" Icon="Lucide.UsersRound" /></Card>
@* Down is good here. *@
<Card><Stat Label="Response time" Value="182 ms" Change="24 ms" Trend="StatTrend.Down" ChangeStatus="Status.Success" TrendLabel="Faster by" Description="vs last week" Icon="Lucide.Timer" /></Card>
</Grid>Sizes
Use Size for the label's and figure's text size.
Preview
- Orders
- 128
- Orders
- 128
- Orders
- 128
Code
<Row Gap="10" Wrap Align="Align.End" Justify="Justify.Center">
<Stat Size="ControlSize.Sm" Label="Orders" Value="128" Change="+8" Trend="StatTrend.Up" />
<Stat Label="Orders" Value="128" Change="+8" Trend="StatTrend.Up" />
<Stat Size="ControlSize.Lg" Label="Orders" Value="128" Change="+8" Trend="StatTrend.Up" />
</Row>Mode support
| Feature | Off | Static | Live |
|---|---|---|---|
| Everything | Yes | Yes | Yes |
Off: JavaScript disabled. Static: a static SSR page with IzzyBlazor's script. Live: an interactive page (Server, WebAssembly or Auto).
Accessibility
- It renders a
dl:Labelis thedt, the value add, and the change and note share a seconddd, so the label names the figure for screen readers. - The trend arrow is hidden from screen readers; the change is read with
TrendLabelin front of it, "Up", "Down" or "No change" by default. - The change's color isn't read, so when the color carries meaning (
ChangeStatus), say it inDescriptionorTrendLabeltoo. - The
Iconis decorative and hidden from screen readers.
Parameters
| Prop | Type | Default |
|---|---|---|
LabelWhat the figure is, such as "Revenue". | string? | |
ValueThe figure, such as "$48,210". | string? | |
ChildContentCustom value content, such as a number with a unit in smaller text. | RenderFragment? | |
ChangeHow much it changed, such as "12%" or "+340". | string? | |
TrendWhich way it moved: adds an arrow before Change and colors it. | StatTrend | StatTrend.None |
ChangeStatusThe change's color. | Status? | |
TrendLabelRead before the change in place of the arrow. | string? | computed |
DescriptionA muted note after the change, such as "vs last month". | string? | |
IconAn icon in a tinted square at the end. | IconData? | |
SizeText size. | ControlSize | ControlSize.Md |
Plus 16 item props and 4 common props.
Full APISee also
- Card: media, header, body sections, actions and footer.
- DescriptionList: terms and their details.
- Progress: a progress bar, determinate or not.
- Badge: a small label for a status, category or count.
- Demos: Store dashboard.