Billing overview (Pro)
ProIncluded in $99Plan, next invoice, usage this period and the card it goes to, on one page, with nothing in the total left to guess.
On this page
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { BillingOverview } from "@/components/ui/chatcn/pro/billing-overview"
<BillingOverview
plan={{ name: "Team", price: "$30", per: "per seat a month", seats: { used: 12, total: 15 }, renewsAt }}
invoice={{
date: renewsAt,
lines: [
{ label: "Team plan, 12 seats", amount: 360, kind: "fixed" },
{ label: "Extra usage", amount: 52.8, kind: "usage", projected: 91 },
],
}}
period={{ start, end }}
usage={[{ label: "Opus messages", used: 2120, limit: 2000, unit: "messages", overage: "$52.80 so far" }]}
payment={{ brand: "Visa", last4: "4242", expires: "08/28" }}
onChangePlan={openPlans}
onViewInvoices={openInvoices}
/>The next invoice separates what is known from what is still growing. Plan lines are fixed; usage lines show the amount so far and, with projected, where they land at the current pace. The bar draws fixed, so far and projected (hatched) on one scale, and the headline says the total so far with the estimate under it, so the bill at the end of the month is not a surprise. Seats draw as cells, usage reuses the free usage-meter with the period and the day of it, and a past-due plan leads the page with the date the card must be fixed by. A plan that cancels says when it ends instead of when it renews. Amounts are formatted with currency and locale.
Examples
States
Props
| Prop | Type | Notes |
|---|---|---|
plan | BillingPlan | { name, price, per, seats?, renewsAt, status?, graceUntil? } |
invoice | { date, lines } | Lines are { label, amount, kind, projected? } |
period | { start, end } | The current billing period |
usage | BillingUsage[] | { label, used, limit, unit?, overage? } |
payment, billingEmail | The card and where invoices go | |
currency, locale, now | Formatting and the day of the period | |
onChangePlan, onManageSeats, onChangePayment, onViewInvoices | Each shows its button | |
labels | Partial<BillingOverviewLabels> | Every string, for translation |
Accessibility
- Each card is a labelled region.
- The invoice bar is an image labelled with the fixed, so far and projected amounts.
- A past due payment is an alert.
Motion
None.