Components · Data Display
Usage Bar
AlphaAdded v11.3.0
A compact used-of-limit bar with its label inline, for table cells and fact grids.
import { UsageBar } from '@nexub/react';Usage
Use it for
A usage column in a table (seats per workspace, quota per key).
A row in a DescriptionList or fact grid.
Use something else for
The headline of a tile: use UsageTile.
A task moving toward done: use Progress.
Playground
Props
size
<UsageBar aria-label="Seats" limit={50} used={18} />Examples
Levels
In a table
States
defaultsize="sm"size="md"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| usedrequired | number | — | The amount used. |
| limitrequired | number | — | The limit. null or Infinity shows the value and "Unlimited", no bar. |
| label | React.ReactNode | 'used / limit'; `false` hides it. | The inline text beside the bar. false hides it. |
| aria-label | string | — | Names the meter, e.g. "Seats". Without it the meter is named by its value. |
| size | 'sm' | 'md' | 'sm' | Bar thickness and label size. |
| 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. |
Accessibility
ARIA roles
A `meter` with `aria-valuenow` as the percentage and `aria-valuetext` such as "42 of 50, 84% used"; the inline label is hidden from assistive tech so it is not read twice.
On iOS & Android
Web only
Usage Bar 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.