Charge Summary

Charge Summary is a copy-paste React component that stops surprise charge at checkout before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/charge-summary
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsSurprise charge at checkout

Was this component page useful?

How do I install Charge Summary?

pnpm dlx shadcn@latest add @bollard/charge-summary

The files land in your project. They're yours to edit.

How do I use Charge Summary in React?

charge-summary-usage.tsx
import { ChargeSummary } from "@/components/ui/charge-summary"

<ChargeSummary
  now="2026-10-13T10:00:00+05:30"
  timeZone="Asia/Kolkata"
  trialEndsAt={trial ? "2026-10-27T10:00:00+05:30" : undefined}
  lines={
    trial
      ? [{ label: "Pro plan, monthly", amount: 499 }]
      : [
          { label: "Pro plan, monthly", amount: 499 },
          { label: "Credit for unused Starter time", amount: -120, recurring: false },
          { label: "One-time setup fee", amount: 49, recurring: false },
        ]
  }
  taxes={[{ label: "GST", rate: 18, inclusive }]}
/>

What input mistakes does Charge Summary catch?

  • A trial that turns into a charge, with the exact date
  • One-time credits or discounts that won't repeat at renewal
  • Taxes added on top versus already included
  • The renewal amount and interval

What props does Charge Summary accept?

ChargeSummary props
PropTypeDefault
lines* (required)

Every line that makes up the charge, fees included, so nothing appears later.

ChargeLine[]—
taxes

Taxes as percentages of the subtotal, e.g. `{ label: "GST", rate: 18 }`, or `inclusive: true` when prices already include it.

ChargeTax[][]
currency

ISO 4217 code.

string"INR"
locale

Locale for amounts and dates.

string"en-IN"
interval

Billing period.

ChargeInterval"month"
intervalCount

How many periods each renewal covers, e.g. 3 for quarterly with `interval="month"`.

number1
trialEndsAt

When the free trial ends. Nothing is charged before then.

Date | string—
now

The checkout moment. Pass it for deterministic rendering; otherwise the current time is read after mount.

Date | string—
timeZone

Time zone used for every date shown.

string—
todayLabel

Heading above the big number.

string"You pay today"
messages

Reword or translate any sentence.

Partial<typeof CHARGE_SUMMARY_MESSAGES>—

* required. Also accepts the native props of <section> (className, aria-*, data-*…), passed through to it.

How is Charge Summary accessible?

  • Wrapped in a region with an aria-label
  • Line items are a description list (<dl>)
  • Icons are aria-hidden; everything is stated in text

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Charge the amount your billing system computes, not the client's figures.

  • Displays the lines and tax rates you pass; it doesn't calculate tax rules
  • Dates use the time zone you pass, or the visitor's

What expensive mistakes does Charge Summary stop?

Surprise charge at checkout

Also known as

order summary · checkout · pricing · subscription · renewal · tax · gst · total

What dependencies does Charge Summary require?

Charge Summary facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameCharge Summary
Registry identifier@bollard/charge-summary
Install commandnpx shadcn@latest add @bollard/charge-summary
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Charge Summary

How does Charge Summary prevent financial transaction errors?

Charge Summary prevents surprise charge at checkout. Blocks A trial that turns into a charge, with the exact date, One-time credits or discounts that won't repeat at renewal, Taxes added on top versus already included, The renewal amount and interval before processing. Limitation: apply idempotency keys for charge-summary.

How do I install charge-summary with shadcn?

Run `npx shadcn@latest add @bollard/charge-summary`. Sources added: registry/default/charge-summary/charge-summary.tsx. Package requirements: lucide-react.

What props customize Charge Summary?

Charge Summary accepts `lines`, `taxes`, `currency`, `locale`, `interval`. Configures order summary, checkout, pricing behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of charge-summary?

Displays the lines and tax rates you pass; it doesn't calculate tax rules. Dates use the time zone you pass, or the visitor's Server requirement: Charge the amount your billing system computes, not the client's figures.

How does Charge Summary meet accessibility guidelines?

Wrapped in a region with an aria-label. Line items are a description list (<dl>). Icons are aria-hidden; everything is stated in text. Minimizes errors: hidden charges checkout, what will i be charged.

Which components pair with Charge Summary?