Skip to content
nexubDesign System
v11.9.0

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';
View as Markdown

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
TSX
<UsageBar aria-label="Seats" limit={50} used={18} />

Examples

Levels

7 · Unlimited

In a table

WorkspaceSeats
Marketing
Finance
Support

States

  • default
  • size="sm"
  • size="md"

Props

Props
PropTypeDefaultDescription
usedrequirednumber—The amount used.
limitrequirednumber—The limit. null or Infinity shows the value and "Unlimited", no bar.
labelReact.ReactNode'used / limit'; `false` hides it.The inline text beside the bar. false hides it.
aria-labelstring—Names the meter, e.g. "Seats". Without it the meter is named by its value.
size'sm' | 'md''sm'Bar thickness and label size.
warnAtnumber0.8Share 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)toLocaleStringFormats 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