Components · Data Display
Usage Tile
AlphaAdded v11.3.0
Used of limit: the value, the limit and a bar that warns near and at the limit.
import { UsageTile } from '@nexub/react';Usage
Use it for
Plan limits on a billing or settings page: seats, storage, API calls.
A dashboard tile where the limit matters as much as the number.
Use something else for
A table cell or fact grid: use UsageBar.
A task moving toward done: use Progress.
A number with its change over time: use KpiTile or StatCard.
Playground
Props
Seats
12/ 50
24% used
<UsageTile label="Seats" limit={50} used={12} />Examples
Under, near and at the limit
Unlimited, note and action
States
- Seats
12/ 50
24% useddefault - Seats
loading
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| labelrequired | React.ReactNode | — | What is being used, e.g. "Seats". Also names the meter. |
| usedrequired | number | — | The amount used. null or undefined shows the empty state. |
| limitrequired | number | — | The limit. null or Infinity shows "Unlimited" and no bar. |
| warnAt | number | 0.8 | Share of the limit that turns the bar to the warning tone. At or over the limit it is the danger tone. |
| valueFormat | ((value: number) => string) | toLocaleString | Formats the value and the limit, e.g. (n) => ${n} GB``. |
| note | React.ReactNode | — | An extra line under the bar, e.g. "Resets on 1 May". |
| action | React.ReactNode | — | A control beside the label, e.g. an Upgrade link. |
| loading | boolean | — | The data states, same as KpiTile: a skeleton, the empty content, or the error content in place of the value. |
| emptyState | React.ReactNode | — | The data states, same as KpiTile: a skeleton, the empty content, or the error content in place of the value. |
| errorState | React.ReactNode | — | The data states, same as KpiTile: a skeleton, the empty content, or the error content in place of the value. |
Accessibility
ARIA roles
The bar is a `meter` named by the label, with `aria-valuetext` such as "42 of 50, 84% used".
Notes
The level is written out ("80% used", "Limit reached"), so colour is never the only signal.
On iOS & Android
Web only
Usage 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.