Skip to content

Dashboard

dashboard

A full application screen that works with no props: a workspace switcher and nav that fold into a drawer on narrow containers, search on /, notifications, a theme toggle, KPI stats, a revenue chart with range and period delta, channels and plan mix, a selectable invoice table with row actions and undo, payouts and an activity feed.

Install

$npxshadcnadd@forme/dashboard

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Dashboard

A full application screen: navigation, search, notifications, the metric row, the revenue chart, channels and plan mix, the invoice table and the activity feed — the parts every product rebuilds, wired to each other and to the tokens.

PropTypeDefaultDescription
brandstring"Acme Inc"
workspacesreadonly string[]["Acme Inc", "Acme Labs", "Northwind"]The other workspaces the switcher offers. The current one is brand.
user{ name: string; email: string }{ name: "Ada Kim", email: "ada@acme.inc" }
kpisreadonly DashboardKpi[]DEFAULT_KPIS
revenuereadonly DashboardRevenueRow[]DEFAULT_REVENUEThe revenue series, oldest first. The range control takes the last 7 or 30 rows for those ranges and everything you pass for the full range — bring ninety days and all three ranges work.
channelsreadonly DashboardChannel[]DEFAULT_CHANNELS
plansreadonly DashboardPlan[]DEFAULT_PLANSPaying accounts per plan, for the plan-mix ring.
ordersreadonly DashboardOrder[]—The invoices. Pass onOrdersChange with it to own the list; leave both out and the dashboard keeps its own copy, so "mark as paid" and "refund" work in a preview.
onOrdersChange(orders: DashboardOrder[]) => void—Called with the whole list after every change, including an undo.
activityreadonly DashboardActivity[]DEFAULT_ACTIVITY
notificationsreadonly DashboardNotification[]DEFAULT_NOTIFICATIONS
payoutDashboardPayoutDEFAULT_PAYOUT
usage{ used: number; limit: number }{ used: 4120, limit: 5000 }

Also takes every prop of <div> attributes.