Skip to content

Inputs

NumberField

Bit.BlazorUINumberInput

A NumberField (number input, spin button) edits a value of any .NET numeric type, with bounds, stepping and snapping, rounding, .NET formatting in any culture, spin buttons in three layouts, the full ARIA spinbutton keyboard set and EditForm validation.

Range & step

Clamping to Min and Max, the step, page step, precision and snapping, and every .NET numeric type.

Min & Max

Min/Max clamp typed and spun values; unset, the range of the type applies. An explicit bound enables Home/End, sets aria-valuemin/max and makes the button that would pass it inert. NoClamp lets a typed out-of-range value through for a validator to report; stepping still stays inside.

value: [0]

value: [0]

value: [0]

value: [0]

Step, precision & snapping

Step is what a spin adds; a fractional one also sets the rounding. PageStep is the PageUp/PageDown jump (10 × Step by default). Precision rounds explicitly - negative rounds to tens, hundreds, ... SnapToStep puts typed values on the step grid, anchored at Min.

value: [0]

value: [0]

value: [0]

value: [0]

value: [2]

value: [0]

Numeric types

Every .NET numeric type and its nullable variant. A number past the type's range clamps to it (300 into a byte gives 255). The type picks the mobile keypad; use InputMode="BitInputMode.Text" when negatives must be typed on touch.

value: [5]

value: [1000000000000]

value: [0.05]

value: [-5]

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.