Skip to content
GitHub (opens in a new tab)

UsageList

A list of usage limits, one a row: the limit's name, how much is used of it, a bar, and a short note.

stableOrganismcontracts/usagelist.json

Preview

UsageList

A list of usage limits, one a row: the limit's name, how much is used of it, a bar, and a short note. Not ListView. Not Table. Not Progress alone.

Master

Three limits: under 80% brand, 80% warning, and 100% danger. Variants show overage and a list with nothing close.

Plan usage

Storage32 of 50 GB
API calls8,420 of 10,000Almost at limit

Resets on Oct 1

Seats12 of 12Limit reached

All seats in use

Usage

Pass real used and limit numbers. The list works out the percent and writes used of limit over a kit Progress bar. Bars turn warning at 80% and danger at 100%. Over the limit still prints the real numbers, with a full red bar. Put the list in a Section or Card for a title; UsageList draws no box of its own. Do not wrap it in both.

Do's

  • A plan, account, or billing page that shows usage against limits, like API calls, storage, and seats
  • A usage panel where people need to spot the limits that are nearly or fully used

Don'ts

<UsageList
  label="Plan usage"
  items={[
    { id: "storage", label: "Storage", used: 32, limit: 50, unit: "GB" },
    { id: "api", label: "API calls", used: 8420, limit: 10000, note: "Resets on Oct 1" },
    { id: "seats", label: "Seats", used: 12, limit: 12, note: "All seats in use" },
  ]}
/>

When to use

  • A plan, account, or billing page that shows usage against limits, like API calls, storage, and seats
  • A usage panel where people need to spot the limits that are nearly or fully used

When not to use

  • Task progress, an upload, or a setup checklist — use Progress or ProgressSteps
  • Records one per row — use ListView
  • Values compared across columns — use Table or DataTable
  • A single KPI — use Scorecard
  • Numbered wizard or checkout steps — use ProgressSteps

What an agent reads

import { UsageList } from "agentic-ds-kit";
must
  • The list is named by label so the number of limits is read (role=list / listitem)
  • Each bar is role=progressbar, named by the limit, the used/limit text, and from 80% Almost at limit or Limit reached
  • State is never color alone
  • Warning and error icons are decorative (aria-hidden) and not in the tab order; their meaning lives in the bar name and in visually hidden text beside the numbers
defaults
  • label Usage
  • hideLimit false
stops if
  • Do not build usage rows from a Table with a Progress column, or from loose bars and text. Use UsageList.
  • Do not use it for task progress, like an upload or a setup checklist. Use Progress or ProgressSteps.
  • Do not use it to compare records across columns. Use Table.
  • Do not use ListView — that is records, not plan limits.
  • Do not use Scorecard — that is a single KPI.
  • Do not pass a percent as used. Pass the real used and limit numbers; the list works out the percent.
  • Do not put it in a Card and a Section at once, or draw a box around it yourself. Title comes from a parent Section or Card.
  • Do not invent a local progress bar — compose kit Progress with showValue={false} and ariaLabel.
  • Do not invent a local icon set — use TriangleAlert and CircleAlert from lucide-react, same as Alert and Toast.
  • Do not use it to rank items by one measure, like top pages or top customers — use BarList
  • Do not use raw hex or primitive --color-* ramps
  • UsageList has no loading or error prop: while its data loads or fails, render kit Skeleton, LoadError or Empty in its place

From contracts/usagelist.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
itemsarrayYes—The limits in order. Keep it short: one to eight. used and limit are real amounts, not a percent. unit writes after the numbers, like GB. note is a quieter line under the bar, like Resets on Oct 1.
labelstringNoUsageNames the list for screen readers, like Plan usage.
hideLimitbooleanNofalseVisible figures show only the used amount, without "of limit", for a breakdown where every item shares one limit. The bar's name still says used of limit.
  • Component
    →

    Progress

    Task completion as a bar or circle from 0 to 100, or an indeterminate bar when the percent is not known.

  • Component
    →

    ProgressSteps

    Ordered wizard steps as numbered circles with a connecting line and a status word under each label: Done, Current, Upcoming, Error, or Optional.

  • Component
    →

    ListView

    A list of records, one row each: primary and optional secondary line, leading avatar or icon, trailing value, badge, actions, or chevron.

  • Component
    →

    Table

    Simple semantic table for invoices, lists, and text rows, with optional sort, row menu, sticky header, loading, empty and error states, row dividers on or off, and one optional highlighted row.