Staaarter

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.

By Staaarter Team
Billing
Updated March 27, 2026
Docs
Live preview

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.json

Prefer 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

PropTypeDefaultDescription
titlestring"Storage"Heading shown at the top of the card.
usedLabelstringnoneFormatted current usage, for example "184 GB".
totalLabelstringnoneFormatted plan limit, for example "200 GB".
usagePercentnumbernoneUsage as a percentage (0 to 100+) used to size the bar and trigger warning states; the caller computes this from raw bytes.
basePriceMonthlynumbernoneCurrent plan price per month, added to the selected tier's price to show the new total.
breakdownStorageBreakdownItem[][]Optional per-resource usage rows shown under the bar, for example files vs. backups vs. media.
tiersStorageTier[]noneSelectable storage add-on options, each with a label and a monthly price.
defaultTierIdstringtiers[0].idWhich tier is selected on first render.
upgradeLabelstring"Upgrade storage"Label on the upgrade button before it's clicked.
classNamestringnoneExtra 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