Quota Forecast

Quota Forecast is a copy-paste React component that stops hit the usage limit by surprise before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/quota-forecast
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsHit the usage limit by surprise

Was this component page useful?

How do I install Quota Forecast?

pnpm dlx shadcn@latest add @bollard/quota-forecast

The files land in your project. They're yours to edit.

How do I use Quota Forecast in React?

quota-forecast-usage.tsx
import { QuotaForecast } from "@/components/ui/quota-forecast"

<QuotaForecast
  label="API calls"
  used={calls}
  limit={limit}
  periodStart={periodStart}
  resetsAt={resetsAt}
  now={now}
  atLimit="At the limit, new calls fail with a 429 error until {reset}."
  actionLabel="Raise limit"
  onAction={() => setLimit(25_000)}
/>

What input mistakes does Quota Forecast catch?

  • Running out before the reset at the current pace, with the date
  • Usage ahead of an even pace
  • Too early in the period to trust a rate: says so
  • What happens at the limit (atLimit)

What props does Quota Forecast accept?

QuotaForecast props
PropTypeDefault
label* (required)

What is metered, e.g. "API calls".

string—
used* (required)

Amount used so far this period.

number—
limit* (required)

The plan's limit for the period.

number—
periodStart* (required)

When the current period started.

Time—
resetsAt* (required)

When usage resets.

Time—
now

The current time. Defaults to the clock, read after mount so SSR stays stable.

Time—
formatValue

Formats amounts, e.g. bytes as "18.2 GB".

(value: number) => string—
locale

Locale for dates and numbers.

string"en-GB"
atLimit

Plain words for what happens at the limit, e.g. "New calls get a 429 error until {reset}."

string—
actionLabel

Fix offered once it's a warning, e.g. "Add credits".

string—
onAction

Runs the fix, e.g. opens the upgrade dialog.

() => void—
warnAt

Share of the limit (0–1) where the tone turns amber.

number—
dangerAt

Share of the limit (0–1) where the tone turns red.

number—
runsOutText

Templates. `{date}`, `{reset}`, `{days}` and `{percent}` are filled in.

string"At this pace you'll run out {date}, {days} before it res…
onTrackText

Shown when usage is on track to fit.

string"On pace for about {percent}% by the reset on {reset}."
earlyText

Shown while it's too early to forecast.

string"Too early to forecast. Resets {reset}."
outText

Shown when the limit is already reached.

string"You've reached the limit. It resets {reset}."

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Quota Forecast accessible?

  • role=meter with min, max, now and aria-valuetext including the forecast
  • Forecast text is a polite live region
  • The even-pace marker is aria-hidden; the message says it in words

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Assumes the average rate so far continues; spikes and seasonality aren't modelled
  • Numbers are what you pass; it doesn't meter usage

What expensive mistakes does Quota Forecast stop?

Hit the usage limit by surprise

Also known as

usage · quota · plan limit · credits · api limit · billing · storage · meter

Field type

What dependencies does Quota Forecast require?

Quota Forecast facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameQuota Forecast
Registry identifier@bollard/quota-forecast
Install commandnpx shadcn@latest add @bollard/quota-forecast
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Quota Forecast

What form validation mistake does Quota Forecast catch?

Quota Forecast prevents hit the usage limit by surprise. Projects current usage to the reset date and warns when you'll run out first, so a usage limit isn't hit by surprise. Catches: Running out before the reset at the current pace, with the date, Usage ahead of an even pace, Too early in the period to trust a rate: says so, What happens at the limit (atLimit). Limitation: validate quota-forecast schemas on backend.

How do I install quota-forecast with shadcn?

Run `npx shadcn@latest add @bollard/quota-forecast`. Sources added: registry/default/quota-forecast/quota-forecast.tsx. Package requirements: lucide-react.

What props customize Quota Forecast?

Quota Forecast accepts `label`, `used`, `limit`, `periodStart`, `resetsAt`. Configures usage, quota, plan limit behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of quota-forecast?

Assumes the average rate so far continues; spikes and seasonality aren't modelled. Numbers are what you pass; it doesn't meter usage Server requirement: backend verification for quota-forecast.

How does Quota Forecast meet accessibility guidelines?

role=meter with min, max, now and aria-valuetext including the forecast. Forecast text is a polite live region. The even-pace marker is aria-hidden; the message says it in words. Minimizes errors: ran out of api quota, usage limit reached suddenly.

Which components pair with Quota Forecast?