TrendBadge
Metrics & Status

TrendBadge

Displays percentage change with an arrow and a tone color.

Props

TrendBadge extends HTMLAttributes<HTMLSpanElement>.

TrendBadgeProps props
PropTypeDefaultDescription
deltanumber—Signed percentage change. Sign picks the arrow direction.
positiveIsGoodbooleantrueWhether an increase is good (revenue) or bad (error rate).
format(delta: number) => string—Formats the number. Default: +4.2%.
labelstring—Dim comparison label after the number (e.g. 'vs last week').

Examples

Positive (up)

+12.5%
TrendBadge positive

Negative (down)

-5.3%
TrendBadge negative

Flat (zero)

0.0%
TrendBadge flat

Increase indicates an error

+8.1%
TrendBadge positiveIsGood false

With label

TrendBadge with label
ImportTSX
import { TrendBadge } from "@solarius/onset";
import type { TrendBadgeProps } from "@solarius/onset";