Skip to main content

Stat

Stat is the metric-summary widget.

Use it when one value deserves emphasis but still needs a label and possibly a short explanation. It works well in dashboards, sidebars, billing summaries, and health indicators.

Example

use fission::prelude::*;

let node = Stat {
label: "Open issues".into(),
value: view.state.open_issue_count.to_string(),
help_text: Some("Updated 2 minutes ago".into()),
}
.build(ctx, view);

Field table

FieldTypeMeaningNotes / default behavior
labelStringSmall explanatory label above the value.Required.
valueStringMain emphasized value.Required. Format numbers, currency, or percentages upstream.
help_textOption<String>Extra context below the value.Defaults to None.

Specific advice

Keep the value itself clean and short. If the user must parse a whole sentence to understand the metric, a stat is probably the wrong presentation.

Badge, Card, Text, and CircularProgress.