Overview
TheNumberRangeFilter class provides two numeric inputs for filtering by a minimum and maximum value range. Values are automatically clamped to the specified bounds.
Creating a NumberRangeFilter
Available Methods
label
min
max
step
key
default
Sets a default range value for the filter.
The default value (array with ‘min’ and/or ‘max’ keys)
initialValue
Sets an initial range value that is pre-applied when the table first loads.
The initial value (array with ‘min’ and/or ‘max’ keys)
filter
Provides a custom query callback to override the default filter behavior.
A closure that receives
Builder $query and mixed $value (array with ‘min’ and ‘max’ keys) and returns the modified BuildergroupClass / labelClass / inputClass
Sets CSS classes for the filter wrapper, label, or input elements.
Value Structure
The filter value is an array withmin and max keys:
Value Clamping
Both min and max values are automatically clamped to stay within the bounds:-10 and max: 1500, they will be clamped to 0 and 1000 respectively.
Default Behavior
By default,NumberRangeFilter applies >= and <= queries:
Complete Examples
Basic Usage
Custom Filter Logic
Usage in Table Component
UI Rendering
The filter renders two numeric inputs side by side:- Min input for the minimum value
- Max input for the maximum value
Decimal Precision
For currency or decimal ranges, use thestep() method: