Billing Storage Quota Manager
A storage quota card for cloud, media, or data-heavy SaaS billing pages. It shows usage against the plan limit with a color-coded progress bar, an optional breakdown by resource type, and a set of selectable storage tiers that recompute the new monthly total as soon as one is picked. The upgrade button shows a loading state, then confirms, without leaving the page.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-storage-quota-manager.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing128.tsx instead.
Usage
The file also exports billing128Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Billing128, billing128Demo } from "@/components/blocks/billing/billing128"; export default function Page() { return <Billing128 {...billing128Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | "Storage" | Heading shown at the top of the card. |
| usedLabel | string | none | Formatted current usage, for example "184 GB". |
| totalLabel | string | none | Formatted plan limit, for example "200 GB". |
| usagePercent | number | none | Usage as a percentage (0 to 100+) used to size the bar and trigger warning states; the caller computes this from raw bytes. |
| basePriceMonthly | number | none | Current plan price per month, added to the selected tier's price to show the new total. |
| breakdown | StorageBreakdownItem[] | [] | Optional per-resource usage rows shown under the bar, for example files vs. backups vs. media. |
| tiers | StorageTier[] | none | Selectable storage add-on options, each with a label and a monthly price. |
| defaultTierId | string | tiers[0].id | Which tier is selected on first render. |
| upgradeLabel | string | "Upgrade storage" | Label on the upgrade button before it's clicked. |
| className | string | none | Extra classes for the outer container. |
Types
interface StorageBreakdownItem { label: string; percent: number; } interface StorageTier { id: string; label: string; priceMonthly: number; }
Behavior notes
- The progress bar switches from primary to amber at 90% usage and to the destructive color at 100% or over; a matching badge and warning note appear at both thresholds.
- Selected tier is local state; picking a different tier recalculates the "New monthly total" line as basePriceMonthly plus the tier's priceMonthly.
- Clicking upgrade moves through idle, loading, and upgraded states with a 900ms simulated delay and a disabled button in between; this is UI feedback only, no request is sent.
- Switching tiers after an upgrade resets the button back to its idle state so the flow can be repeated.
- The bar carries role="progressbar" with matching aria-value attributes, and usage is also shown as plain text above it.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.