AI growth forecast
Shown as Ferrule, a made-up product
Four growth metric cards. Any card morphs into one detail panel with a 30-day forecast cone, a forecasting agent that names what moved the number, a clickable driver waterfall and an alert you can set.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/ferrule-growth.json?token=…"Adds the piece to components/propui/02-ferrule-growth/ 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 row of headline growth metrics that each open into a detail view without leaving the page.
- Showing where a metric is heading, with a forecast range, next to what moved it.
- Letting someone see the accounts behind a change and set an alert on the metric they care about.
Something else fits when
- Traffic and conversion with launches pinned on the chart: Traffic analyst fits better.
- Explaining revenue movement bar by bar for a period: Revenue movement does that.
- A full analytics screen with many panels at once: a dashboard fits better.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/02-ferrule-growth/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace METRICS in data.ts with your own series, definitions and sources, and the driver functions with your ledger. COMPANY and UPDATED set the header; the forecast, deltas and the agent's read are computed from the series.
Your data
Replace these and everything on screen follows.
METRICS{ id; label; short; kind; definition; source; series }[]- The four cards, the panel tabs, the chart and the footer definition.
RANGES{ id; label; days; step; vs }[]- The 30D / 90D / 12M switch and the "vs" line under the value.
mrrDrivers(), accountDrivers()(range) => Driver[]- The What moved it waterfall for revenue and workspaces; the net equals the change on the card.
DOWNGRADES{ name; owner; seats; daysAgo; amount }[]- The three workspaces the agent names under Show the 3 workspaces.
COMPANY, UPDATEDstring- The line under the heading and the export filename.
Interactions
- Click a card: it morphs into the detail panel, with its label, value and sparkline travelling into place.
- Switch metric with the tabs in the panel, and the range with 30D / 90D / 12M.
- Hover or focus the chart to read any day against the previous period; toggle the forecast cone from its legend.
- Click a bar in What moved it to list the workspaces behind it.
- Show the workspaces the agent names, set an alert on net revenue retention and remove it again.
- Copy a link that reopens the exact metric and range, or export the view as CSV.
- Close with the button or Esc: the panel collapses back into the card being shown.
Keyboard
- ←or→
- On the metric tabs, move to the previous or next metric.
- ←or→
- On the focused chart, move a point back or forward.
- HomeorEnd
- On the focused chart, jump to the first or last point.
- Esc
- Close the alert form if it is open, otherwise collapse the panel into its card (not while typing in a field).
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- Each card is a button whose name carries the metric and its value; the panel is labelled with the metric.
- Focus moves into the panel's tab on open and back to the card on close.
- Metrics are tabs with aria-selected; range buttons and waterfall rows use aria-pressed; the agent's two actions use aria-expanded.
- A polite status line announces changes; the alert inputs carry labels.
- Colour pairs meet WCAG AA contrast in both themes.
Motion
- The card to panel morph uses shared layout ids on one spring; a tab switch only moves the tab pill, so the morph never re-keys mid-flight.
- The chart line morphs between ranges and metrics, the value rolls to its new number, and the forecast cone fades in and out.
- Reduced motion makes the morph and chart changes instant and turns the forecast fade off.
Responsive
- Below 1100px the cards form a 2 by 2 grid.
- Below 900px the padding tightens and the waterfall and agent stack.
- Below 640px the cards stack, the header stacks with its title clear of the corner, the chart drops to 210px with three x labels, and the footer stacks.
Performance
- The chart redraws on an animation only while a range or metric change settles.
- All series and drivers come from a seeded generator in memory; nothing is fetched.
- No images: one local font file and inline SVG.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep the shared-element ids pinned to the card that opened the panel; re-keying them mid-morph breaks the animation.
- Keep the drivers reconciled: they must sum to the change shown on the card.
- Light and dark follow the nearest data-theme attribute, or the system setting. Keep colours in the tokens at the top of post.css.
/p/ferrule-growth/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.