Lambchop
Data Display

ComparisonRow

Side-by-side comparison of current vs previous values with delta.

import { ComparisonRow } from "lambchop";

Live Demo

noecho.net
$18,230$15,400 18.4%
theneedledrop.com
$4,100$5,200 21.2%
melodicmag.com
$2,300$2,300 0.0%

Usage

import { ComparisonRow } from "lambchop";

<ComparisonRow
  label="lambgoat.com"
  current={18230}
  previous={15400}
  format={(v) => `$${v.toLocaleString()}`}
/>

Props

PropTypeDefaultDescription
labelstringRow label (e.g., site name)
currentnumberCurrent period value
previousnumberPrevious period value for comparison
format(v: number) => stringtoLocaleString()Custom value formatter
classNamestringAdditional CSS classes

Variants

  • Positive — Current exceeds previous (green delta)
  • Negative — Current below previous (red delta)
  • Equal — No change between periods
  • Currency Format — Custom USD formatting