Staaarter

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.

By Staaarter Team
Billing
Updated August 6, 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-enterprise-billing-portal.json

Prefer 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

PropTypeDefaultDescription
headingstring"Enterprise billing portal"Fallback heading, used if organizationName isn't set.
descriptionstringnoneOptional supporting line under the heading.
organizationNamestringnoneShown as the main heading in place of heading, if set.
billingPeriodLabelstringnoneOptional label for the period the total covers, e.g. "Q2 2026".
consolidatedTotalstringnoneTotal spend across every cost center, shown as-is, e.g. "$482,300".
reportingCurrencystring"USD"Currency code shown under the total.
costCentersCostCenter[]noneRows in the table, each a department or subsidiary.
classNamestringnoneExtra 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