Plan usage comes with Pro. Its preview shows once you unlock it.
Usage
import { SaasUsage } from './SaasUsage.jsx'
// Without onUpgrade the upgrade is "requested" after a short wait. Wire it to your billing page:
<SaasUsage
locale="en"
plan={{ name: 'Team plan', status: 'trial', daysLeft: 12 }} // status: 'trial' | 'active' | 'due' | 'paused'
period={{ start: '2026-11-01', end: '2026-11-30' }}
today={new Date().toISOString().slice(0, 10)}
meters={[
{ id: 'seats', label: 'Seats', used: 6, limit: 8 },
{ id: 'responses', label: 'Responses', used: 3420, limit: 5000, pace: true, breakdown: [{ name: 'Sign-up', value: 1640 }] },
{ id: 'storage', label: 'File uploads', used: 1.2, limit: 5, unit: 'GB', digits: 1 },
]}
alerts={settings.usageAlerts}
onAlertsChange={(on) => saveSettings({ usageAlerts: on })}
onUpgrade={() => router.push('/billing')}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text, numbers, dates and sample usage. |
plan | { name, status: 'trial' | 'active' | 'due' | 'paused', daysLeft? } | sample plan | The plan’s name and state, shown with a status tag; a trial counts its days left. |
period / today | { start, end } / 'YYYY-MM-DD' | November 2026 / 2026-11-18 | The billing period and the day it is now, for the days left and the forecast. |
meters | Array<{ id, label, used, limit, unit?, digits?, pace?, breakdown?: [{ name, value }] }> | sample meters | One line per limit. `pace` marks a meter that grows with use (it gets the forecast); `breakdown` draws it split by source. An empty array shows the empty state. |
alertAt / alerts / onAlertsChange | number / boolean / (on) => void | 0.8 / on | The share of a limit that sends an alert (marked on the breakdown), and the switch that turns those emails on. |
onUpgrade | () => Promise<boolean | void> | — | Upgrade was pressed; the button spins until it resolves. Resolve false to leave it as it was. |
loading / error / onRetry | boolean / boolean | string / () => void | false | The skeleton while usage loads; the error banner with retry (a string replaces its sentence). |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
Add it to your project
Pro includes the full source of this block. Copy its prompt to install it with your coding agent.
SaasUsage.jsxsaas-usage.csscopy.jskit.jsxkit.cssui/base-button/ui/category-bar/ui/empty-state/ui/status-tag/ui/alert-banner/ui/elastic-switch/ui/skeleton-shimmer/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.
