Skip to content
nexubDesign System
v11.9.0

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

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
TSX
<UsageTile label="Seats" limit={50} used={12} />

Examples

Under, near and at the limit

Seats

12/ 50

24% used
Storage

8.6 GB/ 10 GB

86% used
API calls

100,000/ 100,000

Limit reached

Unlimited, note and action

Projects

42

Unlimited
Included in your plan
Seats

46/ 50

92% used
Billed per seat each month

States

  • Seats

    12/ 50

    24% used
    default
  • Seats
    loading

Props

Props
PropTypeDefaultDescription
labelrequiredReact.ReactNode—What is being used, e.g. "Seats". Also names the meter.
usedrequirednumber—The amount used. null or undefined shows the empty state.
limitrequirednumber—The limit. null or Infinity shows "Unlimited" and no bar.
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, e.g. (n) => ${n} GB``.
noteReact.ReactNode—An extra line under the bar, e.g. "Resets on 1 May".
actionReact.ReactNode—A control beside the label, e.g. an Upgrade link.
loadingboolean—The data states, same as KpiTile: a skeleton, the empty content, or the error content in place of the value.
emptyStateReact.ReactNode—The data states, same as KpiTile: a skeleton, the empty content, or the error content in place of the value.
errorStateReact.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