TYPOGRAPHY / COMPONENT 48

Number

React component

Format numeric values with locale-aware tabular typography.

Try it out

Use the live controls or open the Code tab to view and copy the example.

123,456.78$2,500.0087.2%

API reference

Generated from the package’s TypeScript exports. Standard React event and ARIA attributes are also accepted where the component wraps a native element.

PropTypeDescription
valueRequirednumberControlled value. Pair with its change callback.
localestring | undefinedDefault: "en-US"See the typed definition and working example for this option.
formatNumberFormatOptions | undefinedSee the typed definition and working example for this option.
toneTone | "muted" | undefinedSemantic status treatment; always pair color with text.
sizeSize | undefinedSize within the shared component scale.
defaultCheckedboolean | undefinedStandard React / HTML attribute passed to the underlying element.
defaultValuestring | number | readonly string[] | undefinedInitial value for uncontrolled usage.
classNamestring | undefinedAdditional CSS class names.
idstring | undefinedStandard React / HTML attribute passed to the underlying element.
styleCSSProperties | undefinedInline styles, including CSS custom property overrides.
relstring | undefinedStandard React / HTML attribute passed to the underlying element.
onFocusFocusEventHandler<HTMLSpanElement> | undefinedStandard React / HTML attribute passed to the underlying element.
onBlurFocusEventHandler<HTMLSpanElement> | undefinedStandard React / HTML attribute passed to the underlying element.
onChangeChangeEventHandler<HTMLSpanElement, Element> | undefinedStandard React / HTML attribute passed to the underlying element.
onErrorReactEventHandler<HTMLSpanElement> | undefinedStandard React / HTML attribute passed to the underlying element.
onClickMouseEventHandler<HTMLSpanElement> | undefinedStandard React / HTML attribute passed to the underlying element.
weight"medium" | "regular" | "bold" | undefinedSee the typed definition and working example for this option.

Accessibility & interaction

Preserve semantic structure and communicate meaning with text rather than color alone.

Visible focus, reduced motion, and both color themes are shared across staqui. Choose labels and document structure that make sense in your application; automated checks do not replace assistive-technology testing.

Variants & implementation notes

Intl.NumberFormat adds locale/currency/percent formatting beyond tabular styling. Numeric formatting is presentation, not decimal arithmetic.

Use the typed API above for the supported variants. The example demonstrates the primary composition; shared controls inherit hover, focus, active and disabled treatment where applicable.

Compose with