Skip to content
GitHub (opens in a new tab)

ChangeSummary

A compact card of what moved in a period: each metric before → after, with its delta.

stableOrganismcontracts/changesummary.json

Preview

ChangeSummary

A compact “what moved” card: a headline sentence, then before → after, a delta and a why per metric.

Master

The narrated month, grouped by sentiment. Colour follows the sentiment set per metric, not the direction. Variants shows other data sets.

Revenue · What moved

Oct → Nov

Growth came from upgrades and the annual offer; Starter churn doubled after the Oct 28 price change.

Better3

  • Net new MRR up +20.8%, good. $33.7k to $40.7k. Annual offer brought 18 upgrades.
  • Churn rate down −0.5 pt, good. 2.6% to 2.1%. Fewer card failures after retries moved to Friday.
  • MRR up +10.9%, good. $372.1k to $412.6k. Upgrades from Growth to Scale.

Worse2

  • Starter churn up +2.4 pt, bad. 2.4% to 4.8%. Cancellations cite the new Starter price.
  • Failed payments up +5, bad. 9 to 14. Two cards expired at Brightline and Hollis & Grey.

Usage

Each metric sets its own sentiment: churn going down is good. The word good, bad or neutral is always visible, and each row reads as one sentence to screen readers. Lead with summary, group with groupBy sentiment and give each row a short why (no trailing period). onAsk adds an Ask in Chat Button. Use Scoreboard for a row of KPIs and LineChart for a series.

Do's

  • summarise the changes between two periods on a dashboard or report
  • say whether each move is good or bad for the business
  • lead with one sentence on the period and say why each metric moved
  • link to the full report

Don'ts

  • one KPI with a trend — Scorecard
  • a row of KPI tiles — Scoreboard
  • a time series — LineChart
<ChangeSummary
  title="Revenue · What moved"
  period="Oct → Nov"
  summary="Growth came from upgrades and the annual offer; Starter churn doubled after the Oct 28 price change."
  groupBy="sentiment"
  items={[
    { id: "mrr", label: "MRR", before: "$372.1k", after: "$412.6k", delta: "+10.9%", direction: "up", sentiment: "good", why: "Upgrades from Growth to Scale" },
    { id: "starter-churn", label: "Starter churn", before: "2.4%", after: "4.8%", delta: "+2.4 pt", direction: "up", sentiment: "bad", why: "Cancellations cite the new Starter price" },
  ]}
  onViewAll={openReport}
  onAsk={openChat}
/>

A compact "what moved" card for a period: each metric shows before → after and a delta. Good and bad are set per metric (churn down is good), and direction and sentiment are always spelled out. An optional summary sentence leads, rows can be grouped into Better and Worse, and each row can carry a one-line why.

When to use

  • summarise the changes between two periods on a dashboard or report
  • say whether each move is good or bad for the business
  • lead with one sentence on the period and say why each metric moved
  • link to the full report

When not to use

  • one KPI with a trend — Scorecard
  • a row of KPI tiles — Scoreboard
  • a time series — LineChart

What an agent reads

import { ChangeSummary } from "agentic-ds-kit";
must
  • section aria-labelledby the h3 title
  • each row reads as one sentence, e.g. "MRR up +9.8%, good. $48.2K to $52.9K. Upgrades from Growth to Scale."; the visual row is aria-hidden
  • each group is an h4 (Better, Worse, Steady) with its count; its list is aria-labelledby that heading
  • the word good, bad or neutral is visible next to the values, not colour alone
  • aria-busy while loading; the error is role=alert
defaults
  • title What moved
  • viewAllLabel View full report
  • emptyTitle Nothing to compare yet
  • loading false
stops if
  • Do not invent a local DeltaList or MetricChanges
  • Do not colour by direction: sentiment is set per metric
  • Do not show arrows without the word
  • Do not use raw hex

From contracts/changesummary.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
titlestringNoWhat moved—
periodstringNo—e.g. "Oct → Nov 2026"
itemsarrayYes—{ id, label, before, after, delta, direction: 'up'|'down'|'flat', sentiment?: 'good'|'bad'|'neutral', why?: string }[] — values are pre-formatted strings; why is a one-line caption with no trailing period.
summarystringNo—The headline sentence above the rows. With no items it stands alone (a quiet month) instead of the Empty state.
groupBysentimentNo—sentiment groups rows into Better, Worse and Steady, each with a count in a kit Badge. Default: one flat list.
onViewAllfunctionNo—Renders an outline neutral sm Button.
viewAllLabelstringNoView full report—
onAskfunctionNo—Adds a neutral outline sm Button "Ask in Chat" with the MessageCircle icon, e.g. to open Chat on this period.
emptyTitlestringNoNothing to compare yet—
emptyDescriptionstringNo——
loadingbooleanNofalse—
errorstringNo——
onRetryfunctionNo——
  • Component
    →

    Scorecard

    one KPI with label, value, optional delta/trend/hint/badge

  • Component
    →

    Scoreboard

    Metrics strip of kit Scorecards: two to six figures, and the only metric picker.

  • Component
    →

    Line

    Change and progress over ordered samples as a line or area chart.

  • Component
    →

    Empty

    Placeholder when a list, page, or region has nothing to show.