Number
React componentFormat 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.
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.
| Prop | Type | Description |
|---|---|---|
valueRequired | number | Controlled value. Pair with its change callback. |
locale | string | undefinedDefault: "en-US" | See the typed definition and working example for this option. |
format | NumberFormatOptions | undefined | See the typed definition and working example for this option. |
tone | Tone | "muted" | undefined | Semantic status treatment; always pair color with text. |
size | Size | undefined | Size within the shared component scale. |
defaultChecked | boolean | undefined | Standard React / HTML attribute passed to the underlying element. |
defaultValue | string | number | readonly string[] | undefined | Initial value for uncontrolled usage. |
className | string | undefined | Additional CSS class names. |
id | string | undefined | Standard React / HTML attribute passed to the underlying element. |
style | CSSProperties | undefined | Inline styles, including CSS custom property overrides. |
rel | string | undefined | Standard React / HTML attribute passed to the underlying element. |
onFocus | FocusEventHandler<HTMLSpanElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onBlur | FocusEventHandler<HTMLSpanElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onChange | ChangeEventHandler<HTMLSpanElement, Element> | undefined | Standard React / HTML attribute passed to the underlying element. |
onError | ReactEventHandler<HTMLSpanElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onClick | MouseEventHandler<HTMLSpanElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
weight | "medium" | "regular" | "bold" | undefined | See 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.