Billing Invoice Consolidation Settings
A configuration panel for enterprise accounts billing multiple projects or departments. A switch turns consolidation on or off, a group-by control chooses how charges are merged, and a preview line shows exactly how many invoices the account will receive next cycle, all recalculated live as the settings change. A resource list underneath shows what's being billed.
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-invoice-consolidation-settings.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing66.tsx instead.
Usage
The file also exports billing66Demo, 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 { Billing66, billing66Demo } from "@/components/blocks/billing/billing66"; export default function Page() { return <Billing66 {...billing66Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Invoice consolidation" | Block heading. |
| description | string | none | Optional supporting text under the heading. |
| resources | BillingResource[] | none | Billable resources listed at the bottom, each tagged with a department. |
| defaultConsolidate | boolean | false | Whether the consolidation switch starts on. |
| defaultGroupBy | "department" | "project" | "none" | "department" | Which group-by option is active on first render. |
| saveLabel | string | "Save settings" | Label on the bottom save button. |
| className | string | none | Extra classes for the outer container. |
Types
interface BillingResource { id: string; name: string; department: string; monthlyAmount: string; } type ConsolidationGroupBy = "department" | "project" | "none";
Behavior notes
- Consolidation on/off and the group-by choice are both local state, seeded from defaultConsolidate and defaultGroupBy.
- The group-by control is visually and functionally disabled (dimmed and non-interactive) whenever consolidation is off, since grouping only matters once invoices are being merged.
- The invoice-count preview recalculates live: it's resources.length when consolidation is off, the number of distinct departments when grouped by department, and 1 when grouping is set to none, updating instantly as either setting changes.
- 'Group by project' currently falls back to one invoice per resource in the count preview, since the demo data doesn't carry a project field; wire your own project-based grouping logic into that branch if you track projects separately from departments.
- The save button doesn't call anything on its own; it's there to be wired up to your settings save action, reading the current consolidate/groupBy state from wherever you lift it 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.