Staaarter

Billing Add On Usage Breakdown

A usage breakdown for optional add-ons, showing how much of each supplemental feature has been used and what it's costing this cycle. Capped add-ons get a progress bar, and uncapped, usage-based add-ons show a Metered badge with their running cost instead. Built as a static server component since the numbers come from real account data, not user interaction.

By Staaarter Team
Billing
Updated May 29, 2026
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/billing-add-on-usage-breakdown.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing16.tsx instead.

Usage

The file also exports billing16Demo, 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 { Billing16, billing16Demo } from "@/components/blocks/billing/billing16";

export default function Page() {
  return <Billing16 {...billing16Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Add-on usage"Heading in the card header.
descriptionstringnoneOptional supporting sentence under the heading.
itemsAddOnUsageItem[]noneAdd-on usage rows, rendered in the order given.
totalLabelstring"Total add-on cost this cycle"Label for the total row at the bottom.
totalCoststringnoneFormatted total. The total row is omitted entirely when this is not passed.
classNamestringnoneExtra classes for the outer container.

Types

interface AddOnUsageItem {
  id: string;
  name: string;
  used: number;
  limit?: number;
  unit?: string;
  cost: string;
  metered?: boolean;
}

Behavior notes

  • Items with a limit render a progress bar whose fill width is used/limit, capped at 100%. Items without a limit skip the bar entirely.
  • metered is independent of limit, it just controls whether the Metered badge shows next to the name, so an item can be both metered and capped if that fits your pricing model.
  • The total row only renders when totalCost is passed, so the component works equally well as a standalone summary card or as a bare list embedded in a larger page.
  • Progress bars use role="progressbar" with aria-valuenow/min/max, matching the pattern used elsewhere in this category.

Frequently asked questions