Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProA statistic that compares the current value with the previous period, computes the change itself and colours it by whether up is good or bad for that metric.
Derived from this item’s props table, because it declares no controls of its own. This item has no standalone playground, so changes update the code, the share link and the AI prompt.
Use this when a number is only meaningful against the last period and the direction of good differs between metrics.
Do not use it when you need a full trend line (use a chart) or the baseline is unknown.
This item is part of tealmac UI Pro
The source for this item installs with a Pro licence key. Log in with your key to see the install command, or read the Pro setup page.
| Prop | Type | Required | Description |
|---|---|---|---|
title | string | required | - |
current | number | required | - |
previous | number | required | - |
previousLabel | string | optional | What the previous number is, for example "last month". |
lowerIsBetter | boolean | optional | For metrics where down is good (churn, errors, cost). Default false. |
prefix | string | optional | - |
suffix | string | optional | - |
precision | number | optional | - |
The pattern ships with a Testing Library test (statistic-period-compare.test.tsx) that covers the signed percentage, lower-is-better colouring, no change and a zero baseline.