Dashboard
A whole overview screen: KPIs, trend, breakdown, comparison and a ranked list on one date range.
PROGet Dashboard and 168 other Pro components with pro lifetime — Get Pro
- Category
- Data & feedback
- Access
- ProPro · unlocked
- Source
- 487 lines · one file
- States
- 6 drawn
- Kind
- Block
- Added
- 13 Oct 2026
When to use it
Use Dashboard for an analytics page in one component: a KPI strip, a trend chart, a breakdown donut, a comparison bar chart and a ranking, with a range switch and loading, empty and error states. Charts use the theme's grey steps. KPI deltas are fractions (0.12 = +12%).
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Dashboard for this.
Install it: npx shadcn@latest add @liro/dashboard
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/dashboard.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import * as React from "react";
import { Dashboard } from "@/components/ui/dashboard";
export function RevenueDashboard() {
const [range, setRange] = React.useState("30d");
return (
<Dashboard
title="Revenue"
ranges={[{ value: "7d", label: "7 days" }, { value: "30d", label: "30 days" }]}
range={range}
onRangeChange={setRange}
kpis={[
{ label: "Revenue", value: "$24,800", delta: 0.164, period: "vs last period" },
{ label: "Churn", value: "2.1%", delta: -0.004, good: "down" },
]}
trend={{
title: "Revenue over time",
data: [{ day: "1 Oct", revenue: 700 }, { day: "15 Oct", revenue: 920 }],
xKey: "day",
series: [{ key: "revenue", label: "Revenue" }],
description: "Revenue rose from $700 to $920 a day.",
}}
breakdown={{
title: "By plan",
data: [{ label: "Team", value: 18200 }, { label: "Starter", value: 6600 }],
description: "Team plans bring 73% of revenue.",
}}
/>
);
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
title | React.ReactNode | No | – |
description | React.ReactNode | No | – |
ranges | DashboardRange[] | No | – |
range | string | No | – |
onRangeChange | (value: string) => void | No | – |
kpis | DashboardKpi[] | No | Up to four read best; more wrap. Each may carry an `icon`. |
trend | CartesianPanel | No | The wide chart. |
breakdown | { | No | Parts of a whole, beside the trend. |
title | string | Yes | – |
subtitle | string | No | – |
data | DonutSlice[] | Yes | – |
format | (v: number) => string | No | – |
centerLabel | string | No | – |
description | string | Yes | – |
compare | CartesianPanel | No | Bars comparing periods or groups. |
ranking | { title: string; subtitle?: string; items: DashboardRankItem[] } | No | A ranked list with a bar each: top customers, pages, plans. |
actions | React.ReactNode | No | Something extra in the header, beside the range switch. |
loading | boolean | No | – |
error | React.ReactNode | No | Replaces the panels with the reason. |
onRetry | () => void | No | – |
empty | boolean | No | No data in this range. |
Dependencies
npm packages
clsxframer-motionlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themebuttonchartprogresssegmented-controlstateStates
All of them are drawn by the component. None is left for you to design.
- With data
- Loading
- No data in range
- Failed to load
- Range switch
- Narrow
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances