Badge
Compact read-only status or category pill set by the system.
How a value moved: an arrow and the signed change in success, danger or neutral text, with no fill.
How a value moved: an arrow and the signed change, no fill. Money changes are a Delta, never a Badge.
Up $600 against last month, medium size, tone from direction. Variants shows down, flat and tone overrides.
Write the sign in value (+$600, −$90) or say No change, so the arrow and colour are never the only signal. Tone follows direction; override it when a rise is bad news, like costs.
import { Delta } from "agentic-ds-kit";From contracts/delta.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| value | string | Yes | — | The visible change with its sign, e.g. +$600, −$90, +12.4% or No change. The sign or word carries the direction, so the arrow and colour are never the only signal. |
| direction | up | down | flat | Yes | — | ArrowUp, ArrowDown or ArrowRight. flat is no change. |
| tone | success | danger | warning | neutral | No | — | Default from direction: up success, down danger, flat neutral. Override when up is bad (costs, churn) or down is good. |
| goodWhen | up | down | No | — | Which way a change is good: up (pass rate, revenue) or down (cost, latency). With direction up or down the text reads 'Better · +6.3 pts' with CircleCheck or 'Worse · +17%' with TriangleAlert, in place of the arrow. Only Worse carries colour (text-danger); Better stays neutral. tone still overrides the colour. flat is not judged. Words come from KitLabels better and worse. |
| size | sm | md | No | md | sm is 12/16 caption with a 12px arrow, for dense rows. md is 14/20 with a 14px arrow. |
| appearance | plain | soft | No | plain | plain: no fill. soft: the tone's subtle fill at Badge height (sm 20, md 24), radius.sm, Badge's colours (success.subtle / success.fg, danger.subtle / danger.fg, caution.subtle / caution.fg, bg.tray / text.fgMuted). For a trend chip on a KPI (Scorecard deltaAppearance badge). Arrow, sign and Better/Worse stay. |
Compact read-only status or category pill set by the system.
Small number badge for counts, like unread items on a nav link or tab.
Label the user applies or manages: removable, selectable, with optional count, status dot, or avatar.
one KPI with label, value, optional delta/trend/hint/badge