Skip to content
Components / Metrics

Stat

One number with its change and a short trend.

@fabrials/ui
Loading state

List price

$1,284.40

+12.4%vs last 7 days

Requests

48,210

+3.1%vs last 7 days

Cache hit rate

61.2%

No changevs last 7 days

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { Stat, StatGroup } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
label / value / unitstringWhat, how much, in what.
delta / trendstring / up | down | flatThe change, with an icon, not only a colour.
deltaTonepositive | negative | neutralWhether up is good for this number.
sparkline / hintnumber[] / stringRecent values and the comparison period.

Behavior

Tabular figures. A stale value says so in the hint.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.