Customer detail
One customer on one page: plan, money, health, and every invoice, subscription and agent run.
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
- one customer's page in a billing app: how the account is doing, what it owes and who to talk to
- the invoices, subscriptions and history of one customer in tabs, with the agents that act on the account
- you want the whole page done, with past-due, loading and not-found states, and only need to pass data and callbacks
When not to use
- a list of customers to pick from — start from the list-detail pattern
- one invoice as a document — InvoiceDocument
- a customer's billing schedule on its own — BillingSchedule
- the plan and usage page a customer sees about themselves — UsageBilling
Usage
One customer on one page: the plan and status beside their name, then MRR, balance due, lifetime value and a health score. Overview, Invoices, Subscriptions, Activity and Agents tabs sit beside an account rail with the owner, tags, the next renewal and quick actions. Email and Run agent sit in the header, with Pause billing, Export and Delete in its menu. Import it once and pass the customer, their invoices, subscriptions, activity and agents, plus your callbacks. The past-due alert, the frozen invoice column, cards on phones, loading skeletons and not found come with it.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
customer | object | — | { id, name, initials?, src?, tone?: "neutral" | "info" | "success" | "warning" | "accent", plan, status: "active" | "past-due" | "churn-risk", since, mrr, mrrChange?, balanceDue, lifetimeValue, health, owner: { name, email?, src?, tone? }, tags?: string[], nextRenewal?: { date, amount }, contacts?: { id, name, role, email?, phone?, src?, tone?, billing? }[], billing?: { address?, paymentMethod?, terms?, currency?, taxId? }, notes?: { id, author: { name, email?, src?, tone? }, body, when }[] } | null The customer. Money (mrr, balanceDue, lifetimeValue, nextRenewal.amount) is in US dollars; mrrChange is the percent against last month; health is 0 to 100 (70 and up Good, 40 to 69 Fair, under 40 At risk, said in words beside the Meter). since, dates and when are shown as given. status past-due puts a warning Alert above the Scorecards that says how much is overdue, with View invoices and Email plus the billing contact's name ("Email Priya Shah"). The billing contact is marked Billing in Contacts. Sample Northwind customer Acme Logistics when omitted; null shows Not found. |
invoices | array | — | { id, number, date, at, amount, status: "paid" | "open" | "overdue" | "draft" | "void", due, dueAt, late? }[] Newest first. at and dueAt (epoch ms) sort the Issued and Due columns; date, due and late are shown as given. Overdue invoices drive the Balance due badge and hint, the Overview Alert and the past-due Alert. The row menu has View and Download PDF, plus Send reminder on open and overdue invoices and Void on open, overdue and draft ones. Sample invoices when omitted. |
subscriptions | array | — | { id, plan, seats, price, interval: "month" | "year", renews, status: "active" | "trialing" | "past-due" | "canceled" }[] One Card each with seats, price per interval and the renewal date (Trial ends for trialing, Ends for canceled). Sample subscriptions when omitted. |
activity | array | — | { id, type: "payment" | "payment-failed" | "email" | "agent" | "invoice" | "note", title, detail?, actor?, day, when }[] Newest first. day is the group the row sits under ("Today", "Nov 17"), shown as given in the order the rows first use it. type picks the icon (CreditCard, CircleX in danger, Mail, Bot, FileText, StickyNote); the title says what happened. Sample activity when omitted. |
agents | array | — | { id, name, icon?, status: "active" | "paused" | "needs-attention" | "draft", lastAction?: { text, when, runId? } }[] The agents that work on this customer, with the Agents list status words. View run (with runId) and Open agent go through onNavigate. Sample Dunning, Collections and Refunds when omitted. |
tab | enum | — | The open tab. Left out, the screen keeps it, starting on Overview. |
onTabChange | function | — | (tab) => void. A tab, or View invoices in an Alert. |
onAction | function | — | (action, id?) => void. action is "email" | "run-agent" from the header; "pause-billing" | "resume-billing" | "export" | "delete" from its row menu (Delete asks first in a kit AlertDialog and fires on Delete customer); "view-invoice" | "download-invoice" | "send-reminder" | "void-invoice" with the invoice id; "email-contact" with the contact id; "add-note" from Notes; "create-invoice" | "send-statement" | "log-call" from Quick actions. Pause billing adds a Billing paused Badge until Resume billing. |
onNavigate | function | — | (destination, detail?) => void. destination is an app nav row ("overview" | "customers" | "invoices" | "subscriptions" | "agents"), "customers" from the breadcrumb and Back to customers, or from the Agents tab "run" ({ agentId, runId }: Run / Handoffs) and "agent" ({ agentId }). |
workspace | object | — | { name: string, icon?: KitIcon } App nav brand. Same shape as SettingsPreferencesScreen. Example workspace 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). Same shape as SettingsPreferencesScreen. Example person when omitted. |
loading | boolean | false | The breadcrumb and the title stay (Badges left out, actions disabled); the Scorecards, the tab and the rail are Skeletons; main is aria-busy. |
className | string | — | On the root layout-shell. |
States
- page: default, loading, empty, past-due, invoices-tab, activity-tab
- customer: active (Badge Active, success tone, CircleCheck), past due (Badge Past due, warning tone, Clock; a page warning Alert above the Scorecards), churn risk (Badge Churn risk, warning tone, TrendingDown), not found (customer null: kit Empty "We can't find this customer" with Back to customers; shown for the empty page state)
- invoice: paid (success, CircleCheck), open (info, Clock), overdue (danger, CircleX; Due shows how late in words), draft (neutral outline, CircleDashed), void (neutral, Ban)
- subscription: active (success, CircleCheck), trialing (info, Hourglass; Trial ends), past due (warning, Clock), canceled (neutral, CircleSlash; Ends)
- layout: tabs beside the account rail (--grid-breakpoint-md and wider), the rail under the tabs and the nav in a left Drawer (below --grid-breakpoint-md), Invoices as a drill ListView of cards and a smaller Avatar (below --grid-breakpoint-sm)
Accessibility
- Renders its own main landmark, named with the customer's name; the app SideNav is an aside named App. Don't wrap the screen in another main
- The Breadcrumb is a nav named Breadcrumb; Customers is a button that calls onNavigate("customers")
- PageHeader title is the page h1; tab panel and rail Cards are h2
- Tabs is a kit tablist named with the customer's name and sections ("Acme Logistics sections") with its own tabpanel; arrow keys move between tabs and the Invoices tab says its count
- The account rail is an aside named Account
- Status is a Badge with the word and an icon everywhere (customer, invoice, subscription, agent); an overdue invoice says how late in words; the health Meter has Good, Fair or At risk beside it; never colour alone
- The header row menu is named More actions for and the customer's name ("More actions for Acme Logistics"); invoice row menus are named Actions for and the invoice number ("Actions for INV-1048"); Email, View run and Open agent buttons name the contact or agent
- The row menus work by keyboard, close on Escape and return focus to the control that opened them
- Delete asks first in a kit AlertDialog with Delete customer as the danger action
- Below --grid-breakpoint-md the nav opens from an IconButton named Menu into a kit Drawer
- loading sets aria-busy on main
- No motion of its own
Responsive
- Wide (--grid-breakpoint-md and wider): SideNav on the canvas, the page on the inset panel, the tabs beside the account rail (layout-split--primary)
- The Invoices Table freezes its first column when it scrolls sideways, as at a 1024 viewport beside the rail
- Below --grid-breakpoint-md: the nav moves into a left kit Drawer and the rail goes under the tabs
- Below --grid-breakpoint-sm: Invoices become a drill ListView of cards (number, due date, amount, status and a menu without View, since the card opens the invoice) and the Avatar goes from xl to lg, over the title; the Scorecards wrap two by two, then one by one, through layout-metrics
- 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; Run agent is the only one
- Do not show status, an overdue invoice or health by colour alone
- Do not use raw hex
Built from
Related
- Pattern
List detail
A list of invoices beside the one you opened.
- Component
InvoiceDocument
A document view for an invoice or a credit note, not a PDF engine: header with status and actions, bill-to and dates, line items, totals and one line about payment.
- 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).
- Block
Usage & billing
Plan usage and what it costs, with the next invoice estimate and past invoices.