Skip to content

UsageBar

How much of a plan's limit is used: «7.2 GB of 8 GB». Near the limit it says what will happen and offers the next step before it is reached.

import { UsageBar } from '@sypnia/ui/react'

On this page
  1. The limits of a plan
  2. When to use it
  3. For everyone
  4. Props

The limits of a plan

Rows120,400 of 500,000
Storage6.7 GB of 7.5 GB
90% used: it will soon be full.See larger plans
Emails this month10,000 of 10,000
The limit is reached: new data is not saved.Starts again on Dec 1, 2026Move to Pro
Code
import { LinkButton, UsageBar, useSypnia } from '@sypnia/ui/react';

// The limits of a plan. Near the limit it says so and offers the next step.
export default function Plan() {
  const { format } = useSypnia();
  const gb = (v: number) => format.bytes(v * 1e9);
  return (
    <div className="sy-stack">
      <UsageBar label="Rows" used={120_400} limit={500_000} />
      <UsageBar label="Storage" used={7.2} limit={8} format={gb} action={<LinkButton href="#plans" size="sm">See larger plans</LinkButton>} />
      <UsageBar label="Emails this month" used={10_000} limit={10_000} resetsAt="2026-12-01" action={<LinkButton href="#plans" size="sm" variant="primary">Move to Pro</LinkButton>} />
    </div>
  );
}

When to use it

Use it when

  • Billing and plan pages, and the overview of a project.
  • Pass action with a link to the plans, and resetsAt for monthly limits.

Do not use it when

  • Measures without a plan behind them: use Meter.

For everyone

  • It is a meter; the warning near the limit is said in words.

Props

UsageBarTypeDefault
labelrequired ReactNode
limitrequired number
usedrequired number
action

The next step, shown from 80 %: usually a LinkButton to the plans.

ReactNode
format

How amounts are written: bytes, rows, requests. Defaults to a number.

((v: number) => string)
loading

The amount is on its way: the label stays, the amount and the bar are skeletons. Pass the last known `used` and `limit`, so the amount's bar is as long as its words will be.

boolean
resetsAt

When the count starts again, for monthly limits.

string | number | Date
  1. The limits of a plan
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms