Skip to content
GitHub (opens in a new tab)

Delta

How a value moved: an arrow and the signed change in success, danger or neutral text, with no fill.

stableAtomcontracts/delta.json

Preview

Delta

How a value moved: an arrow and the signed change, no fill. Money changes are a Delta, never a Badge.

Master

Up $600 against last month, medium size, tone from direction. Variants shows down, flat and tone overrides.

+$600

Usage

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.

Do's

  • Which mark: Delta is how a value moved (arrow and sign, no fill, success or danger text). A money change is a Delta, never a Badge.
  • A money or metric change next to a value, like +$600 vs October
  • The change column in a table (kit Cell trendPositive / trendNegative)
  • The delta line on a KPI (kit Scorecard delta)
  • A change where up is bad, like cost or latency: pass goodWhen so the text says Better or Worse

Don'ts

  • Status the system sets (Paid, Overdue) — use Badge
  • How many items — use Count
  • A label the user adds — use Tag
  • A whole KPI tile — use Scorecard
<Delta
  value="+$600"
  direction="up"
/>

When to use

  • Which mark: Delta is how a value moved (arrow and sign, no fill, success or danger text). A money change is a Delta, never a Badge.
  • A money or metric change next to a value, like +$600 vs October
  • The change column in a table (kit Cell trendPositive / trendNegative)
  • The delta line on a KPI (kit Scorecard delta)
  • A change where up is bad, like cost or latency: pass goodWhen so the text says Better or Worse

When not to use

  • Status the system sets (Paid, Overdue) — use Badge
  • How many items — use Count
  • A label the user adds — use Tag
  • A whole KPI tile — use Scorecard

What an agent reads

import { Delta } from "agentic-ds-kit";
must
  • The arrow and the Better/Worse icons are aria-hidden; the value text says the change and its sign
  • With goodWhen the Better or Worse word is in the visible text, so the icon and colour only repeat it
  • Colour is never the only signal: the arrow shape and the sign or word carry the direction
  • Amounts use tabular numbers so columns line up
defaults
  • size md
  • appearance plain
stops if
  • Do not invent a local trend chip or coloured number
  • Do not use Badge for a money or metric change
  • Do not put a fill or border behind a Delta by hand; for a trend chip pass appearance soft
  • Do not drop the sign from value; write +$600 or −$90, or No change
  • Do not add a second Better or Worse prefix to value; pass goodWhen
  • Do not use raw hex or primitive --color-* ramps
  • Do not swap a Delta for a Badge to get a filled trend chip; use appearance soft

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.

Props

NameTypeRequiredDefaultNotes
valuestringYes—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.
directionup | down | flatYes—ArrowUp, ArrowDown or ArrowRight. flat is no change.
tonesuccess | danger | warning | neutralNo—Default from direction: up success, down danger, flat neutral. Override when up is bad (costs, churn) or down is good.
goodWhenup | downNo—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.
sizesm | mdNomdsm is 12/16 caption with a 12px arrow, for dense rows. md is 14/20 with a 14px arrow.
appearanceplain | softNoplainplain: 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.
  • Component
    →

    Badge

    Compact read-only status or category pill set by the system.

  • Component
    →

    Count

    Small number badge for counts, like unread items on a nav link or tab.

  • Component
    →

    Tag

    Label the user applies or manages: removable, selectable, with optional count, status dot, or avatar.

  • Component
    →

    Scorecard

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