Slider Filter
Index
Overview
The Slider Filter is an interactive numeric filter that allows users to select values or ranges within a defined minimum and maximum by dragging one or more slider handles. It's ideal for filtering numeric data such as prices, ratings, percentages, or any continuous numeric values.
SlickGrid Universal provides three slider filter variants via the Filters enum:
Filters.slider- Single value slider filterFilters.sliderRange- Range slider filter with two handlesFilters.compoundSlider- Single value slider with operator selection dropdown
Demo
Single Slider
Slider Range (double handles)
Filter Types
Single Slider Filter (Filters.slider)
A single-value slider that filters data based on a single numeric threshold. Useful when you want to filter "greater than", "less than", or "equal to" a specific value. You can define such operator via your column definition.
Operators: >, >=, <, <=, =, <>, !=
Slider Range Filter (Filters.sliderRange)
A dual-handle slider that filters data within a numeric range. Useful for filtering data between two values (e.g., price range from $100 to $500).
Operators: rangeInclusive (default) or rangeExclusive
Compound Slider Filter (Filters.compoundSlider)
A single-value slider combined with an operator dropdown menu. This allows users to select both the operator and the numeric value without typing, providing a better UX.
Operators: >, >=, <, <=, =, <>, !=
Basic Usage
To use any slider filter, set filterable: true on your column and define the filter object with the desired model:
Single Slider Filter
Example with custom options:
Slider Range Filter
Example with range slider:
Compound Slider Filter
Example with operator dropdown:
Slider Options
The following options can be configured via the options object in your filter definition:
Common Options (SliderOption)
enableSliderTrackColoring
boolean
false
Show color on the slider track to visually represent the selected range
hideSliderNumber
boolean
true
Hide the numeric value display to the right of the slider
sliderStartValue
number
-
Initial position of the slider handle
sliderTrackFilledColor
string
#3C97DD
Color of the filled slider track (can also use CSS variable --slick-slider-filter-filled-track-color)
useArrowToSlide
boolean
true
Allow arrow keys to adjust the slider value instead of grid navigation
filterWhileSliding
boolean
false
Trigger filter in real-time as the user slides, instead of waiting for completion
Range-Specific Options (SliderRangeOption)
hideSliderNumbers
boolean
false
Hide numeric values displayed on both sides of the range slider
sliderEndValue
number
-
Initial position of the right handle in range slider
stopGapBetweenSliderHandles
number
0
Minimum gap (in units) between the two slider handles
Operators
Single & Compound Slider Operators
>
Greater than
>=
Greater than or equal to
<
Less than
<=
Less than or equal to
= or ==
Equal to
<> or !=
Not equal to
Range Slider Operators
rangeInclusive- Include the boundary values (default)rangeExclusive- Exclude the boundary values
Filter While Sliding
By default, the slider filter only applies when the user finishes dragging the slider handle. To apply the filter in real-time as the user slides, set the filterWhileSliding option to true:
This is useful for providing immediate visual feedback but can impact performance with very large datasets.
Styling the Slider
You can customize the slider appearance using the available options:
Alternatively, you can override the CSS variable to change the default track color globally:
Grid Options
To apply default slider options to all slider filters in your grid, use the defaultFilterOptions in Grid Options:
Last updated