Skip to content
Sign upPro
SettingsBilling overviewMenu

Billing overview (Pro)

ProIncluded in $99

Plan, next invoice, usage this period and the card it goes to, on one page, with nothing in the total left to guess.

ProA team mid period and over its Opus allowance: the next invoice shows what is fixed, what is so far and where it lands.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/billing-overview

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

tsx
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

ProA failed payment with its deadline, and a plan that will not renew.

Props

PropTypeNotes
planBillingPlan{ name, price, per, seats?, renewsAt, status?, graceUntil? }
invoice{ date, lines }Lines are { label, amount, kind, projected? }
period{ start, end }The current billing period
usageBillingUsage[]{ label, used, limit, unit?, overage? }
payment, billingEmailThe card and where invoices go
currency, locale, nowFormatting and the day of the period
onChangePlan, onManageSeats, onChangePayment, onViewInvoicesEach shows its button
labelsPartial<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.