Numeric presentation
- Product prices, metrics, counts, measurements and numeric tables.
Composition and API
NumberText accepts value, locale and formatOptions, separately from native CSS style. Optional partClassNames styles native parts without replacing characters or rearranging them. Tabular digits are the default. useNumberFormat returns format, formatToParts, resolvedLocale and formatter, backed by a cache of at most 50 instances.
Accessibility
Keep the formatted text readable and preserve every native part, including spacing and signs. Numeric strings are not parsed. NaN, infinity and negative zero use Intl output; an application can validate inputs or supply its own empty/error state. Display precision is presentation rather than arithmetic.
FAQ
Does NumberText animate a localized value?
No. NumberText is static and has no Motion dependency. The separate integer motion example uses a localized accessible count alongside decorative digit animation.
What happens without a locale?
The deterministic default and final preference fallback is en-US. Invalid locale syntax and invalid Intl options still throw native errors. Matching Intl locale data is required for exact output across environments.