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-haptics

Usage

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

PropTypeDefaultDescription
labelstringWhat the number is.
valuestringThe number, formatted. It shrinks to fit.
changestring–Change against the last period; a leading minus turns it red.
tone'success' | 'danger' | 'muted'–Overrides the colour picked from the sign.
captionstring–Small text after the change.