Loading component…
Loading component…
What moved since last time – one metric per row with a colored trend
To reuse this local React demo, copy all files from the Code tab into the same folder, then import ChangeSummary from ./change-summary.
import { ChangeSummary } from "@/components/ui/change-summary";
const changes = [
{ label: "Active users", change: "Up 6.1% to 18.2K", tone: "good" },
{ label: "Churn", change: "Down to 2.1% from 2.6%", tone: "good", direction: "down" },
{ label: "Support tickets", change: "Up 14% to 312", tone: "bad", direction: "up" },
];
export function Recap() {
return <ChangeSummary period="This week" changes={changes} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| changes | MetricChange[] | label, change text, tone (good, bad, neutral) and the arrow direction | |
| title | string | "What's changed" | Heading in the gray tray |
| period | string | Small text on the right of the heading | |
| icon | ReactNode | Replaces the icon in front of the heading | |
| className | string | Extra class on the tray |
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.