Skip to content

Number input

The number input collects a numeric value. Create one with NumberInput::make().

NumberInput::make('age', 'Age')
->min(0)
->max(120)

->min() and ->max() bound the value; ->step() sets the increment used by the spinner controls and accepts decimals for fractional values such as prices. These constrain the browser control; add matching validation rules to enforce them on the server.

NumberInput::make('unit_price', 'Unit price')
->min(0)
->step(0.01)
->rules(['numeric', 'min:0']);

->slider() renders the field as a range slider instead of a spinner. Pair it with ->min() and ->max() so the track has defined bounds.

NumberInput::make('satisfaction', 'Satisfaction')
->slider()
->min(0)
->max(10)

->prefix() and ->suffix() add a currency symbol, unit, or icon to the input. See affixes on Text input for the full rules. Affixes apply to the spinner variant only — they are not rendered in slider mode.

NumberInput::make('price', 'Price')->prefix('$')->suffix('USD');

NumberInput shares label, default value, required, disabled, read-only, and visibility options with every field — see Fields. For validation and conditional behavior, see Validation and Conditional fields.