affectUI › Components › Data display

Change Summary

What moved since last time – one metric per row with a colored trend.

Free and open source (MIT). Install: npx shadcn@latest add https://www.affectui.com/r/change-summary.json · Import from @/components/ui/change-summary

When to use

  • A short recap at the top of a dashboard or a weekly report
  • Explaining in words what changed, next to the charts that show it

When not to use

  • Exact values people compare over time – use the KPI Chart or a table
  • More than about six metrics – the recap stops being a quick read

Usage

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} />;
}

Props

NameTypeDefaultDescription
changesMetricChange[]label, change text, tone (good, bad, neutral) and the arrow direction
titlestring"What's changed"Heading in the gray tray
periodstringSmall text on the right of the heading
iconReactNodeReplaces the icon in front of the heading
classNamestringExtra class on the tray

Accessibility

  • A description list, so each change is read together with its metric
  • The trend arrow is decorative – the text says what happened

Responsive

  • Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"

Requirements

  • React 19

Related

  • KPI Chart – Metric card with a multi-line chart and a tooltip that follows the pointer
  • Decision Inbox – Open decisions with two quick answers each – answered ones confirm and fold away