SaaS revenue and usage
Shown as Halyard, a made-up product
A dark glass revenue and usage desk for an API platform: metric strip, crosshair MRR chart, quote builder, subscriptions with usage.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/halyard-saas.json?token=…"Adds the piece to components/propui/03-halyard-saas/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- A revenue and usage overview for a subscription or API business, on a dark ground.
- Letting a sales or revenue team price a plan for a prospect next to the numbers.
- A first screen that pairs a few headline metrics with one chart you can switch between them.
Something else fits when
- A light, print-like product: Print farm floor or AI agent runs sit on light grounds.
- Many products side by side: SaaS portfolio compares a portfolio.
- A real checkout: the quote builder only prices; use a form with validation and payment.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/03-halyard-saas/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace METRICS, STRIP, TILES, PLANS and SUBS in data.ts. The headline copy, the welcome line and the sidebar's counts are written in Section.tsx; change them with the data.
Your data
Replace these and everything on screen follows.
METRICS{ key; code; name; kind; value; change; vs; subLabel; series: Record<Range, Point[]> }[]- The three metric cards, their sparklines and the main chart for 1D, 1W and 1M.
Point{ label; value; sub }- One chart point; sub is the second line in the crosshair readout.
STRIP{ label; value; change; good }[]- The service strip under the top bar.
TILES{ key; label; value; unit; delta; good }[]- The four small figure tiles beside the chart.
PLANS, ANNUAL_OFF{ key; name; seat; note }[], number- The quote builder's plans and the annual discount.
SUBS{ id; company; plan; seats; mrr; status; started; order; usage }[]- The subscriptions table and the pinned accounts in the sidebar.
Interactions
- Pick a metric card to drive the main chart; switch 1D, 1W or 1M.
- Move the pointer over the chart for a crosshair, a dot on the line and a readout.
- Build a quote: pick a plan, set seats with the stepper or by typing, choose monthly or annual; totals roll to the new value.
- Sort the subscriptions table by seats, MRR or start date.
- Hover the half-hour load bars to read requests at that time.
- Collapse the sidebar to icons.
Keyboard
- Tab
- Move between controls, the service strip and the table.
- EnterorSpace
- Press the focused button: pick a metric, a range, a billing period, sort a column.
- ↑or↓or←or→
- In the plan list, move between plans (native radio buttons).
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- Metric cards, range buttons and the billing switch are buttons with aria-pressed; range and billing are labelled groups.
- Plans are native radio inputs in a fieldset with a hidden legend; the focus ring moves to the plan's label.
- The seat stepper's buttons and field have labels; sortable headers carry aria-sort.
- The main chart is an image whose label gives the metric, range and its first and last values.
- The service strip and the table sit in focusable, labelled regions so they can be scrolled from the keyboard.
- The crosshair readout and the load bars respond to the pointer only; there is no keyboard path to each point.
Motion
- The main moment: the MRR figure in the header counts up over 1.6 seconds on load.
- The chart line draws in over 1.1 seconds whenever the metric or range changes, as the old line fades out.
- Quote totals glide to new values on one spring and retarget mid-flight if you keep clicking.
- Reduced motion: the count-up is skipped and quote figures jump to their values; MotionConfig follows the system setting, so transform animations stop.
Responsive
- Above 1180px: a 224px sidebar (64px collapsed) and a four-column grid, with the quote builder down a 310px right column.
- At 1180px and below the sidebar and the section tabs hide; the metric cards stay three across and everything else spans the full width.
- At 640px and below everything stacks in one column, the tiles go two by two and the add button shows only its icon.
- The piece fills its parent's height; the main area scrolls inside it.
Performance
- No animation loop, canvas or timers; the chart is one SVG redrawn when the metric or range changes.
- Series are generated once from fixed seeds, so server and client render the same.
- No images: four local font files (Geist Sans in two weights, Geist Mono, Funnel Display) and inline SVG.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep figures in data.ts. The header's MRR comes from METRICS[0]; the lede, '£3,410 added' and 'updated 2 min ago' are written in Section.tsx.
- Every series has 48 points; the x-axis labels read points 0, 12, 24, 36 and 47, so keep that length or update the axis.
- Classes use the wl- prefix and every selector is scoped under .wl, despite the Halyard name; keep colours in the tokens at the top of post.css.
- The root is height: 100%, so give its parent a height (for example 100dvh).
/p/halyard-saas/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.