Billing Enterprise Billing Portal
A consolidated billing dashboard for enterprise accounts with multiple departments or subsidiaries. It shows one reporting-currency total at the top and a table of cost centers underneath, each with a spend-versus-budget bar and a status badge that's computed automatically from how much of the budget has been used. Built for headquarters-level accounts that pay for several sub-accounts from a single view.
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-enterprise-billing-portal.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing54.tsx instead.
Usage
The file also exports billing54Demo, 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 { Billing54, billing54Demo } from "@/components/blocks/billing/billing54"; export default function Page() { return <Billing54 {...billing54Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Enterprise billing portal" | Fallback heading, used if organizationName isn't set. |
| description | string | none | Optional supporting line under the heading. |
| organizationName | string | none | Shown as the main heading in place of heading, if set. |
| billingPeriodLabel | string | none | Optional label for the period the total covers, e.g. "Q2 2026". |
| consolidatedTotal | string | none | Total spend across every cost center, shown as-is, e.g. "$482,300". |
| reportingCurrency | string | "USD" | Currency code shown under the total. |
| costCenters | CostCenter[] | none | Rows in the table, each a department or subsidiary. |
| className | string | none | Extra classes for the outer container. |
Types
interface CostCenter { id: string; name: string; department?: string; spend: number; budget: number; status?: "on-track" | "warning" | "over-budget"; }
Behavior notes
- When a cost center's status isn't set, it's derived from spend divided by budget: 100% or more is over-budget, 85% or more is a warning, otherwise it's on track. Passing status explicitly always overrides the calculation.
- The spend bar's width is capped at 100% even if spend exceeds budget, so an over-budget row still shows a full bar rather than overflowing the track.
- consolidatedTotal and each row's spend and budget are separate values with no cross-validation. It's up to the caller to make sure the total actually reflects the sum of the cost centers.
- There's no internal state, everything renders from props, so this component doesn't need 'use client' and works fine inside a server component page.
- The table scrolls horizontally on narrow viewports via overflow-x-auto instead of reflowing into cards, keeping all three columns aligned at any width.
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.