deltaValue Renderer
renderAs: 'deltaValue' renders a signed numeric change with color coding and an optional directional label (UP, DOWN, FLAT). Use it for period-over-period variance, KPI movement, or any metric where direction matters.
Core Examples
Basic Delta
Signed numeric change with UP/DOWN/FLAT label and green/red/grey coloring.
{
key: 'change',
renderAs: 'deltaValue',
renderAsOptions: { trendIndicator: true, fractionDigits: 1 },
}
Zero and Label Control
Zero values render as FLAT with no sign prefix. trendIndicator: false removes the label entirely, leaving only the signed number — useful when space is tight or when the color alone is sufficient.
Aurora is zero: shows 'FLAT 0.0' with label, '0.0' without. Mateo is negative: 'DOWN -22.0' vs '-22.0'. Priya is positive: 'UP +14.5' vs '+14.5'.
// With trend label
{ renderAs: 'deltaValue', renderAsOptions: { trendIndicator: true, fractionDigits: 1 } }
// Zero → 'FLAT 0.0' Negative → 'DOWN -22.0' Positive → 'UP +14.5'
// Without trend label
{ renderAs: 'deltaValue', renderAsOptions: { trendIndicator: false, fractionDigits: 1 } }
// Zero → '0.0' Negative → '-22.0' Positive → '+14.5'
Percent Suffix
suffixPercent: true appends % to the formatted number. Combine with trendIndicator for compact KPI cells. A zero value renders as FLAT 0.0%.
Two percent-change columns — one non-zero and one zero (FLAT).
{ key: 'pct', renderAs: 'deltaValue', renderAsOptions: { suffixPercent: true, trendIndicator: true, fractionDigits: 1 } }
{ key: 'yoy', renderAs: 'deltaValue', renderAsOptions: { suffixPercent: true, trendIndicator: true, fractionDigits: 1 } }
Custom Palette
Override the default green/red/grey palette with your own brand colors.
Same change values using a blue/crimson/slate palette instead of the default green/red/grey.
{
key: 'change',
renderAs: 'deltaValue',
renderAsOptions: {
trendIndicator: false,
fractionDigits: 1,
palette: { positive: '#0284c7', negative: '#b91c1c', neutral: '#64748b' },
},
}
Options Reference
| Option | Type | Default | Effect |
|---|---|---|---|
trendIndicator | boolean | true | Prepend UP, DOWN, or FLAT to the value. |
suffixPercent | boolean | false | Append % after the formatted number. |
fractionDigits | number | 0 | Decimal places (clamped 0–6). |
palette.positive | string | '#2f855a' | Color for positive values. |
palette.negative | string | '#c53030' | Color for negative values. |
palette.neutral | string | '#718096' | Color for zero values. |
className | string | unset | Additional CSS class on the root element. |
Caveats
- Non-numeric values (including
null,undefined, and unparseable strings) render the plain textInvalidwith no color applied. - Zero values use an empty sign prefix — they render as
0.0(orFLAT 0.0withtrendIndicator), never as+0.0. - Positive values are always prefixed with
+; negative values with-. There is no option to suppress the sign independently oftrendIndicator. paletteaccepts partial overrides — you can override onlypositiveand letnegativeandneutralfall back to their defaults.fractionDigitsis clamped to[0, 6]. Values outside this range are silently clamped.formattercan pre-process the value before rendering. Use it to normalise units (e.g. convert basis points to a decimal) before the sign and color logic runs.
See Also
- sparkTrend Renderer — trend line over time series data
- currency Renderer — monetary values with sign coloring
- number Field Type
- Field Config