Components · Data Display
KPI Tile
BetaAdded v4.5.0
A headline number with its change versus last period and a trend line.
import { KPITile } from '@nexub/react';Playground
Props
Monthly revenue$68,420+11.4% versus last period
<KpiTile value="$68,420" trend={[42, 48, 45, 56, 61, 68]} label="Monthly revenue" change={0.114} />Examples
Dashboard row
States
- Monthly revenue$68,420+11.4% versus last period
default - Monthly revenue
loading
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| labelrequired | string | — | What the number is. |
| valuerequired | React.ReactNode | — | The formatted number. |
| change | number | — | Change as a fraction, e.g. 0.114 for +11.4%. |
| invert | boolean | false | Down is good (churn, costs): flips the colour. |
| trend | number[] | — | Recent values for the sparkline, oldest first. |
| emptyState | React.ReactNode | — | Shown in place of the value when value is null or undefined. No default. |
| errorState | React.ReactNode | — | Shown in place of the data when a load failed, for example an ErrorState with a retry action. Wins over loading and empty. |
| loading | boolean | — | Shows a skeleton in place of the data and sets aria-busy. |
Accessibility
Screen reader
The drawing is hidden from assistive tech; a visually hidden table or caption carries every value.
On iOS & Android
Web only
KPI Tile has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.