Billing schedule
Next charge, a failed-payment notice, and every charge with its status.
Install
Not exported from agentic-ds-kit. add copies the source into your app (components/patterns/billing-schedule/) with this contract beside it. You own the copy: replace the demo data, rearrange or drop sections, and keep the must lines.
Usage
What a copy keeps
The contract’s must lines: the kit look and accessibility. Ask before breaking one.
- Render the schedule with the kit BillingSchedule (view="full", or "nextOnly"); do not rebuild its table, failure Alert, next-charge panel or states locally
- Use kit components from agentic-ds-kit for anything the kit has; no local cousins (tables, dialogs, rows, rules, charts)
- Semantic tokens only (agentic-ds-kit/tokens.css); no raw hex, no primitive --color-* ramps
- At most one appearance="solid" mode="primary" Button per view
- Do not restyle kit components; change them through their props, slots, and tokens
- Status is a word in a kit Badge (Upcoming, Retrying, Invoiced, Paid, Failed, Waived), never colour alone
- Upcoming and billed charges are one kit Table; do not build a local charges list
- A failed payment that nothing has paid since is a kit Alert (danger) with the amount and date in its title, then when the retry runs and what to do before then
- The next charge says Next charge in words after its description
- Edit is a kit Drawer on scheduled charges only (no pencil on retries or billed rows); Skip asks once in a kit AlertDialog
- Every date reads 01 Dec 2026
- Money arrives pre-formatted from your app; label example data as example
- Render inside a main landmark (wrap the pattern, or your page content, in <main>); header and nav chrome, if any, use AppHeader / SideNav (or other header / nav landmarks) and nav stays reachable on small screens
Defaults you can change
- Each state sits in a kit Card (size sm) and uses the Card's own header: title Billing schedule, the plan name as its description, and Ask (outline, MessageCircle) and Download all (ghost) as headerAction. Download all hides while the failure Alert shows
- One Table (size lg) with Date (mono, first), Description, Status and Amount (end-aligned, mono, 500). Upcoming charges come first, oldest first, then billed charges, newest first. Below 480px the rows stack (Table stack)
- Description has a muted second line (Prorated for 14 days, Credit applied); a failed charge's line is danger text (Card declined). A waived amount is subtle
- The earliest row still due (scheduled or retrying) says Next charge after its description in info text, and its date and description read in the strong text colour
- Status Badges are size sm with no icon: Upcoming primary, Retrying warning, Invoiced neutral, Paid success, Failed danger, Waived neutral
- With an open failed payment, the failure Alert sits above the table with Update card, the one solid primary
- Row actions show only when you pass their handler: the edit pencil with onSaveCharge, Download on billed rows with onDownloadInvoice. Both are icon Buttons (Table rowActionsAs="icons") named with the charge and date or the invoice
- The edit Drawer is md on the right: Charge date (DatePicker), Amount (CurrencyInput), Apply to (RadioGroup, only for a split fee), Skip this month in footerStart, then Cancel and Save changes. After Save the row moves, focus returns to its pencil and a polite status says where it moved
- nextOnly shows only the next-charge panel: Next charge on the date and the figure, a vertical Divider, Pays with and the payment method, then Change card (outline) on the right. It stacks below 40rem
- summary is the overview card for a Billing page (the settings example uses it): no next-charge panel, the first `limit` charges (default 3) in two columns, charge with date and status, and amount, so it fits a half-width column, plus View all (ghost) via onViewAll
- Loading is the Table loading state in the same four columns (header stays, Skeleton rows); empty is a kit Empty (CalendarDays, a curated icon) with one muted line; a load error is a danger Alert with Retry (outline, RotateCcw through action.icon)
Built from
Related
- Component
BillingSchedule
A customer's billing schedule in a kit Card, one closed view: full (all charges in one Table), nextOnly (the next charge and its card) or failed (the open failed payment).
- Component
Card
Framed tile with optional header, body, and footer actions.
- Component
Table
Simple semantic table for invoices, lists, and text rows, with optional sort, row menu, sticky header, loading, empty and error states, row dividers on or off, and one optional highlighted row.
- Component
AlertDialog
Must-choose overlay that interrupts until the user cancels or confirms.