ComponentsInputs and forms
Numeric field
A text field bound to a number, with bounds, steps, spin buttons and culture-aware formatting. Use it for quantities and measurements people type; use a slider when the rough position matters more than the exact value.
Bounds and steps
Min and Max clamp the value; Step sets how far the spin buttons, arrow keys and mouse wheel move it. The type parameter decides integer or decimal input.
s
°
2 seats · 4 s exposures · altitude 45°
Formats and cultures
Format is a .NET numeric format string; Culture decides the decimal and group separators. The bound value stays a plain number in every culture.
°C
Bound values: 1234567.89, -4.5, 12800
Nullable values
Bind a nullable type when “no answer” differs from zero. Clearable returns the field to null.
%
arcsec
Cloud cover: 20% · seeing: not recorded
Spin buttons and variants
Spin buttons help with small adjustments. Hide them for long numbers such as years or postcodes, where nobody clicks up a thousand times.
M
Bakery order
Sourdough loaf
£4.80 each
£9.60
Cardamom bun
£2.60 each
£15.60
Rye crispbread
£3.40 each
£3.40
Discount
%
−£2.86
Total
£25.74
Validation, disabled and read-only
Validation functions see the parsed number. Disabled and read-only fields keep their formatting.
Playground
Change any parameter; the markup below updates with only the values that differ from the defaults.
s
<MudNumericField
@bind-Value="_exposure"
Label="Exposure"
Variant="Variant.Outlined"
Min="0.5m"
Max="30m"
Step="0.5m"
Format="F1"
Adornment="Adornment.End"
AdornmentText="s" />