
Summary
Pill-shaped numeric control with − / + buttons and an animated NumberFlow display.| Class | Bjanczak\FilamentFlexFields\Filament\Forms\Components\NumberStepper |
| State type | int|float|null when nullable() |
| Model cast | 'quantity' => 'integer' or 'decimal:2' |
| FieldType | number_stepper |
Basic usage
Validation
| Method | Effect |
|---|---|
integer() | Adds integer rule. Enabled by default. |
minValue($n) | Adds min:$n when not nullable |
maxValue($n) | Adds max:$n |
Configuration API
minValue(scalar|Closure|null $value) / maxValue(scalar|Closure|null $value)
Lower and upper bounds.
step(int|float|Closure $step = 1)
Increment / decrement step.
integer(bool|Closure $condition = true)
Restrict to whole numbers.
nullable(bool|Closure $condition = true)
Allows null. Displays nullLabel or —.
variant(string|Closure $variant)
| Value | Description |
|---|---|
default | White circular buttons on grey track. |
primary | Filled primary buttons. |
secondary | Primary-tinted buttons. |
tertiary | Grey buttons. |
outline | Outlined buttons. |
prefix(string|Closure|null $prefix) / suffix(string|Closure|null $suffix)
Static text before / after the numeric value in the display.
nullLabel(string|Closure|null $label)
Text shown when the value is null.
decrementIcon(string|Closure|null $icon) / incrementIcon(string|Closure|null $icon)
Custom Heroicon for − and + buttons.
icons(array|Closure $icons)
Shorthand:
reversed(bool|Closure $condition = true)
Swaps the visual order of decrement and increment buttons.
decimalPlaces(int|Closure|null $places)
Fixed decimal places in the display.
wheelAnimated(bool|Closure $condition = true)
NumberFlow wheel animation on value change. Default: true.
size(string|ControlSize|Closure $size)
See Control size.
FlexField schema config
| Config key | Maps to |
|---|---|
min | minValue() |
max | maxValue() |
step | step() |
size | size() |
variant | variant() |
prefix | prefix() |
suffix | suffix() |
null_label | nullLabel() |
icons | icons() |
decrement_icon | decrementIcon() |
increment_icon | incrementIcon() |
reversed | reversed() |
decimal_places | decimalPlaces() |
wheel_animated | wheelAnimated() |
integer | integer() |
nullable | nullable() |