Billing Overage Charges
A breakdown of plan-limit overages, one row per resource, each showing a usage bar against the included limit, how far over the account is, the applicable unit price, and the resulting overage cost. A total sums every resource's overage at the bottom, with an optional link to upgrade plans. Built for consumption-based products where surprise charges are the biggest source of billing support tickets.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-overage-charges.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing82.tsx instead.
Usage
The file also exports billing82Demo, 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 { Billing82, billing82Demo } from "@/components/blocks/billing/billing82"; export default function Page() { return <Billing82 {...billing82Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Overage charges" | Panel heading. |
| description | string | none | Optional line under the heading. |
| billingPeriodLabel | string | none | Optional date-range badge shown at the top right, e.g. "Jul 1 - Jul 31, 2026". |
| resources | OverageResource[] | none | Resources rendered as rows in the order given. |
| totalOverage | string | none | Formatted sum of every resource's overage cost, shown in the footer. |
| upgradeLabel | string | "See upgrade options" | Label for the optional upgrade button. |
| upgradeHref | string | none | When set, shows the upgrade button under the total; omitted entirely otherwise. |
| className | string | none | Extra classes for the outer container. |
Types
interface OverageResource { id: string; label: string; unit: string; included: number; used: number; unitPrice: string; overageCost: string; }
Behavior notes
- Whether a resource is over its limit is computed from used and included on every render (Math.max(0, used - included)); there's no separate isOver flag to set by hand.
- A resource's bar and status text switch to destructive red only once used exceeds included; resources still within their limit show a muted "Within plan" label instead of a cost.
- overageCost is a plain string you compute and pass in per resource, the component doesn't parse unitPrice or do currency math itself.
- totalOverage is also a separate prop rather than a sum the component calculates, so it always matches whatever rounding or currency logic you use on the backend.
- The upgrade button only renders when upgradeHref is passed, so the block works standalone as a pure breakdown when there's nothing to upgrade to.
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.