Numeric Input Test

Numeric, currency and percentage entry with localised formatting, tabular numerals, and strict value semantics.

Number mode (default)

Plain numeric entry. No symbol, no rounding unless decimals is set.

Currency mode

Currency formatting with symbol from Intl.NumberFormat.

Percent mode

Value is the displayed magnitude. 12.5 displays 12.50% and submits 12.5 — never 0.125.

Negative with parentheses

negative-style="parens" shows (1,234.00) while value stays -1234.

Steppers

Increment/decrement buttons. 20px tall each on fine pointers; 44x44 side by side on touch.

All sizes

Three-step scale: sm (32px), md (40px, default), lg (48px).

Invalid range

min/max violations set rangeUnderflow/rangeOverflow. This example uses the invalid attribute to force the display for the Percy snapshot — invalid is author-forced and does not clear on its own; the component's own live range check does (see the next example).

Live range validation

Type a value below 10 or above 100. validate-on="input" updates the visible message and accessible invalid state as you type. Correct the value to clear the error, then enter another out-of-range value. Focus and the insertion point remain in the same input throughout.

Readonly

Focusable, submitted, not editable. Surface uses --theme-background-secondary.

Disabled

Not focusable, not submitted. Opacity reduced.

Column alignment

Four stacked inputs with values of different magnitudes. Tabular numerals and right alignment keep decimal points in a column.

Dark theme

The same components in dark theme. Toggle the theme switch in the toolbar to compare.

Native reporting fieldset state

The fieldset supplies the group name and ancestor disabled state. Writing disabled=false to a child cannot bypass its disabled parent; the current value survives disabling and re-enabling.

Reporting snapshot

Reporting fieldset is enabled.