Mobile › Display
Stat
One number on a card with its label and its change, for dashboards, health and money screens.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { Stat } from "plankui-mobile";
<Stat label="Steps today" value="8,412" change="+12%" caption="vs yesterday" />iOS and Android
iOS: A card with tabular digits, so numbers don't jump as they change.
Android: The same card with Material's rounder corners.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | What the number is. | |
| value | string | The number, formatted. It shrinks to fit. | |
| change | string | – | Change against the last period; a leading minus turns it red. |
| tone | 'success' | 'danger' | 'muted' | – | Overrides the colour picked from the sign. |
| caption | string | – | Small text after the change. |