Pass the value and its kind. Put a NumberTextEmpty inside for a metric that has no data yet.
october-stats.tsx
NumberText
<data>| Prop | Type | Default | Description |
|---|---|---|---|
| currency | string | — | The ISO 4217 code of currency and compactCurrency. Default "USD". |
| unit | string | — | The Intl unit of the value for unit ("millisecond", "meter", "celsius"). Required for unit. |
| unit | "long""narrow""short" | — | The unit text: "short" (default, 1.53 sec, 1.8 MB), "narrow" (1.53s), or "long" (1.53 seconds, 1.8 megabytes). |
| compact | number | — | compact and compactCurrency write the full value below this size. Default 10,000. |
| sign | — | The sign rule of Intl ("auto", "always", "exceptZero", "negative", "never"). Default "auto"; change defaults to "exceptZero", so 0 has no sign. | |
| minor | "always""auto" | — | The minor digits (cents) of currency and of compactCurrency below compactFrom: "auto" (default) drops them from a whole value ($49, $49.50); "always" writes them on every value ($49.00), for a receipt, a price list, or a column of amounts that must line up. The currency sets the count (2 for USD, 0 for JPY: ¥12,000 in both modes). |
| value | number | null | — | The number, or the start of a range. null, undefined, and NaN show the empty text. |
| end | number | null | — | The end of a range: "$10–20K", "1st–3rd", "1.2–4.8 GB" (formatRange, so the locale picks the dash and writes the shared parts once). A range never rolls. |
| kind | "bytes""change""compact""compactCurrency""currency""number""ordinal""percent""unit" | "number" | The kind of text, the names of createNumberFormat: number (default), compact (184K), currency, compactCurrency ($48.2K), percent (a ratio: 0.024 is 2.4%), change (a signed ratio: +12.4%), unit (with unit; it climbs a ladder: 1532 ms is 1.53 sec), bytes (720 GB), ordinal (1st, 22nd in English). |
| format | NumberFormatOptions | — | Raw Intl.NumberFormat options in place of kind, for a value that a page already formats with Intl ({ style: "unit", unit: "fahrenheit" }). Nothing is cut, so there is no Tooltip. |
| tooltip | boolean | true | When the text is shorter than the value (184K, 1.53 sec): a dotted underline, a Tooltip with the full value on hover, focus, and press. Default true. false shows the short text only. |
| animated | boolean | false | Rolls the digits on a change (the Rolling Number). Default false: the text swaps. |
| locale | string | — | The BCP 47 locale. Default: the DisplayLocaleProvider locale, else "en-US". |
| children | ReactNode | — | A NumberTextEmpty part: the words of no value. With a value, they are not drawn. |
| ...props | <data> attributes | — | Every other attribute goes to the <data>, with a ref. |
NumberTextEmpty
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| data-slot | string | — | The data-slot of the root: the item's own slot ("time-ago"). Default "empty-value". |
From Base UIUseRenderBase UI docs | |||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Tab | Moves to a shortened value and shows the full value in a Tooltip. |
|---|
Built with
Installs with Number Text
- Components
- Full Value,Rolling Number



