Skip to content
IzzyBlazor 0.1.0-alpha.17

Enter all results ↑ ↓ move Esc close

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

razor
<Stat Label="Revenue" Value="$48,210" Change="12%" Trend="StatTrend.Up" Description="vs last month" />

Use Trend and Change for how the figure moved; ChangeStatus colors a drop that's good news.

Sizes

Use Size for the label's and figure's text size.

Preview

Orders
128
Up +8
Orders
128
Up +8
Orders
128
Up +8

Code

Sizes.razor
<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

What works in each mode, Stat
FeatureOffStaticLive
EverythingYesYesYes

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: Label is the dt, the value a dd, and the change and note share a second dd, so the label names the figure for screen readers.
  • The trend arrow is hidden from screen readers; the change is read with TrendLabel in 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 in Description or TrendLabel too.
  • The Icon is decorative and hidden from screen readers.

Parameters

Stat parameters
PropTypeDefault
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.StatTrendStatTrend.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.ControlSizeControlSize.Md

See also