Billing Schedule

Build a contract's billing phases and see every invoice it will produce.

PROGet Billing Schedule and 168 other Pro components with pro lifetime — Get Pro

Category
Billing
Access
Pro
Source
1,749 lines · one file
States
8 drawn
Added
21 Oct 2026

The decision inside it

You see the invoices, not just the totals

Under the form is every bill, month by month, with any odd one explained ("Dec 2027 includes a $120.00 top-up to reach the minimum"). A gap or overlap between phases shows between them with a Fix button, and Save stays off until they line up.

When to use it

Use Billing Schedule to set up a contract's billing: phases with items, discounts and minimums, and a preview of every invoice it will produce, with gaps and overlaps between phases flagged before Save. Amounts are integer cents; the maths is exported for your server.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Billing Schedule for this.
Install it: npx shadcn@latest add @liro/billing-schedule
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/billing-schedule.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/contract-billing.tsx
import { BillingSchedule, type SchedulePhase, type ScheduleProduct } from "@/components/ui/billing-schedule";

const products: ScheduleProduct[] = [
  { value: "platform", label: "Platform", price: 40000 },
  { value: "seats", label: "Extra seats", price: 2000 },
];

const phases: SchedulePhase[] = [
  {
    id: "p1", start: "2027-01-01", duration: { months: 12 }, minimum: 492000,
    lines: [{ id: "l1", product: "platform", quantity: 1, price: 40000, repeat: "monthly", timing: "advance" }],
  },
];

export function ContractBilling({ save }: { save: (phases: SchedulePhase[]) => Promise<void> }) {
  return <BillingSchedule subtitle="Vertically · 2027 renewal" products={products} defaultValue={phases} onSave={save} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
valueSchedulePhase[] NoControlled phases.
defaultValueSchedulePhase[] No–
onChange(phases: SchedulePhase[]) => void No–
productsScheduleProduct[] NoThe catalogue offered in each item's product combobox.
allowCustomProductsboolean NoAllow typing a product that is not in `products`. Default true.
currencystring NoISO 4217. Default `USD`.
localestring NoDefault `en-US`.
titlestring NoDefault "Billing schedule".
subtitleReact.ReactNode NoWhose contract this is: "Vertically · 2027 renewal".
onSave(phases: SchedulePhase[]) => void | Promise<void> NoMay return a promise. Disabled while any blocking issue remains.
saveLabelstring NoDefault "Save schedule".
lookLook NoLayered puts the total in the tray, the phases on the card and the save state in the strip. Flat is one card.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-themebuttoncomboboxinputsegmented-controlselect

States

All of them are drawn by the component. None is left for you to design.

  • Simple yearly
  • Ramp deal
  • Discount
  • Minimum top-up
  • Gap
  • Overlap
  • Saving
  • Saved

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances