Billing ops command center
The morning page for a billing ops lead: what is at risk today, what agents are doing about it, and what needs a person.
What a screen is
A screen is a whole page exported from the kit, built only from kit components and tokens. Import it once, pass your data and callbacks, and render it as the page: it brings its own nav and <main>, and its loading and empty states are built in. A pattern is the copy-in version you own and change; a block is one area that sits inside your <main>.
When to use
- the first page a billing or finance operations lead opens in the morning
- money at risk (failed payment runs, disputes, overdue accounts) next to the agent actions that wait for a person
- you want the whole page done, with incident, all clear, loading and error states, and only need to pass data and callbacks
When not to use
- one customer's page — CustomerDetailScreen
- a revenue dashboard with Ask and a Revenue tab — start from the dashboard pattern
- a queue of every agent request across the product — NotificationsInboxScreen or AgentInbox
- the steps of one agent run — RunHandoffs or RunDetail
Usage
A Today / 7d / 30d range and one primary action sit in the header, then Billed, Collected, Overdue and Failed payments. Needs attention lists failed payment runs, disputes and big overdue accounts with a severity in words, over the Billed against Collected chart. Beside them, Waiting on you holds the agent actions to approve and Agent activity shows what the agents did. A row opens a Drawer with the run, the account or the approval and the next step. Import it once and pass your data and callbacks. The incident alert, all clear, loading and error states come with it.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
metrics | array | — | { id, label, value, delta?, trend?: "up" | "down" | "flat", goodWhen?: "up" | "down", hint?, sparkline?: number[] }[] The KPIs for the current range, in order: Billed, Collected, Overdue (hint: how many invoices), Failed payments. value and delta are shown as given. goodWhen down on Overdue and Failed payments so a rise reads Worse. The card with id overdue is the hero: size lg, its sparkline drawn as reference with the chart first and last labels and the last 3 points marked, and its hint followed by how late the oldest overdue attention row is ("42 invoices · oldest 41 days late"). The others are sm cards in a divided strip beside it. With an incident, the failed card gets a danger Run failed Badge. Without an overdue metric the four cards share one Scoreboard. Sample data for the range when omitted ($1.24M billed and $186K overdue across 42 invoices month to date). |
attention | array | — | { id, kind: "failed-run" | "dispute" | "overdue", severity: "critical" | "high" | "medium", title, detail, amount, meta?, runId?, customerId?, facts?: { label, value }[], steps?: { id, label, status: "done" | "failed" | "pending", duration?, sublabel? }[] }[] Needs attention rows, grouped Failed runs, Disputes, Overdue accounts. amount is in US dollars. Severity is a Badge in words (Critical danger, High warning, Medium neutral); critical rows also colour their icon. facts and steps fill the Drawer. The count of overdue rows badges Invoices in the nav. [] is the all clear day (kit Empty). Sample rows when omitted. |
approvals | array | — | { id, agent, title, description?, risk: "low" | "medium" | "high", action: ApprovalCardAction, facts?: { label, value }[], requestedAt, status?: "pending" | "approved" | "denied" }[] Agent actions that wait for a person. Pending ones are drill rows in Waiting on you (the action, the agent and when, a risk Badge and an outline Review). The row or Review opens the kit ApprovalCard in the Drawer, where Approve is the one solid primary. Approve or Deny calls onApprove or onDeny, takes the row out and says so in a Toast; the last one says All caught up and the rail shows kit Empty. When every approval passed is already decided, the page opens with that Toast. Sample approvals when omitted. |
activity | array | — | { id, at, agent: { id, name, initials? }, sentence, meta, reason?, undoUntil?, state?: "undone" | "final", note? }[] Agent steps for ActivityFeed variant agent, newest first by day. undoUntil shows Undo until then, which calls onAction("undo", id). Sample steps when omitted. |
chart | object | — | { labels: string[], billed: number[], collected: number[], title } Billed against Collected, cumulative, for the current range, as a LineChart area in --chart-1 and --chart-2. title is the chart heading and states the finding. Sample data for the range when omitted. |
incident | object | — | { runId, title, description?, affectedIds: string[] } | null A failed payment run. A danger Alert opens the page with View run (opens the row runId in the Drawer). The rows in affectedIds move into an Affected by <run> group at the top of Needs attention with a danger Run failed note. |
range | enum | — | Controlled range for the KPIs and the chart; the subtitle says it (Today so far, Last 7 days, Month to date). Uncontrolled with defaultRange (default 30d); onRangeChange(range) fires from the SegmentedControl. Pass metrics and chart for the new range. |
onOpen | function | — | (kind: "attention" | "approval", id) => void. A row opened in the Drawer. |
onApprove | function | — | (id) => void. Approve in the Drawer's ApprovalCard. |
onDeny | function | — | (id) => void. Deny in the Drawer's ApprovalCard. |
onAction | function | — | (action, id?) => void. action is "retry-runs" (header) or "new-invoice" (header when no run failed); "retry-run", "respond-dispute" or "send-reminder" from the Drawer with the row id; "undo" with the activity id. Retry, Respond and Send reminder say so in a Toast. |
onNavigate | function | — | (destination, detail?) => void. destination is an app nav row ("overview" | "customers" | "invoices" | "subscriptions" | "agents"), or from the Drawer "run" ({ runId }) and "customer" ({ customerId }). |
workspace | object | — | { name: string, icon?: KitIcon } App nav brand. Northwind when omitted. |
user | object | — | { name: string, email?: string, src?: string } Account menu at the foot of the app nav (kit DropdownMenu: the avatar on the rail, the account card in the Drawer, both with src as the photo and an online presence mark; the menu holds View profile, Account settings, Documentation, Switch account with a sample second account, Add account and Sign out, all samples that only close the menu except Account settings, which goes to a Settings row when the screen has one). |
loading | boolean | false | The title stays and the range and primary are disabled; Skeletons for the KPIs, Needs attention, the chart, Waiting on you and Agent activity; main is aria-busy. |
error | object | — | { title, reference? } | null The data failed to load: kit LoadError in place of the page body with the reference and Try again (onRetry). The nav and title stay; the range and primary are disabled. |
onRetry | function | — | () => void. Try again on the LoadError. |
className | string | — | On the root layout-shell. |
States
- page: default, loading, empty, incident, approvals-cleared, error
- header: runs failed (Retry failed runs (n), the one solid primary), no failed runs (New invoice, the one solid primary)
- attention: critical (Badge Critical, danger tone; danger icon), high (Badge High, warning tone), medium (Badge Medium, neutral tone), affected by the failed run (in the Affected group with a danger Run failed note), all clear (attention [] : kit Empty "All clear today")
- approvals: pending (rows with a risk Badge Low, Medium or High risk and Review), in the Drawer (ApprovalCard; Approve is the Drawer's one solid primary), decided (row leaves; Toast Approved or Denied), cleared (Toast All caught up; kit Empty "Nothing waiting on you")
- layout: Needs attention and the chart beside the Agents rail (--grid-breakpoint-lg and wider), the rail under the main column (below --grid-breakpoint-lg), the nav in a left Drawer (below --grid-breakpoint-md), the range full width under the title, the KPI strip stacked under the hero and the Drawer full screen (below --grid-breakpoint-sm)
Accessibility
- Renders its own main landmark named Billing operations; the app SideNav is an aside named App. Don't wrap the screen in another main
- PageHeader title is the page h1; Card titles are h2
- The range is a kit SegmentedControl, a radiogroup named Date range
- The KPIs are a group named Key figures: the Overdue Scorecard and a Scoreboard named More figures; each delta says Better or Worse with an arrow
- The rail is an aside named Agents
- Severity, risk, run failed and status are words in Badges or notes, never colour alone
- Review buttons name the action ("Review Retry PR-2291 on the backup processor?"); action text truncates, the button stays
- Needs attention rows are drill buttons that open the Drawer; the Drawer returns focus on close
- Toasts are role=status
- loading sets aria-busy on main
- No motion of its own
Responsive
- Wide (--grid-breakpoint-lg and wider): SideNav on the canvas, the page on the inset panel, the main column beside the Agents rail (layout-split--primary)
- Below --grid-breakpoint-lg: the rail goes under Needs attention and the chart
- Below --grid-breakpoint-md: the nav moves into a left kit Drawer behind a Menu IconButton
- Below --grid-breakpoint-sm: the range SegmentedControl goes full width under the title, the hero Scorecard goes md with the other three stacked under it, the chart is 160 tall and the detail Drawer fills the screen
- Dark mode follows the root theme; semantic tokens only
Do not
- Do not copy the screen's parts into a local cousin; change it through its props or compose the kit pieces yourself
- Do not wrap it in an app shell or another main
- Do not add a second solid primary Button; the header has exactly one and each Drawer has its own
- Do not show severity, risk or a failed run by colour alone
- Do not use raw hex
Built from
Related
- Screen
Customer detail
One customer on one page: plan, money, health, and every invoice, subscription and agent run.
- Pattern
Dashboard
Billing home: four KPIs that drive the revenue chart, Needs attention, overdue invoices, a Revenue tab of analysis charts, and an Ask panel.
- Screen
Notifications inbox
Every notification on one page, grouped by day, and acted on in place.
- Component
AgentInbox
A queue of what agents need from you: approvals, questions, failed runs and finished recaps.