Skip to main content

Example

{% slider id="age_slider" data="users" value_column="age" /%}

Attributes

id
String
required
The id of the slider to be used in a filters prop
title
String
Text displayed above the slider
info
String
Information tooltip text
URL to link the info text to (can only be used with info)
Create a custom link title for the info link, placed after the info text (can only be used with info_link)
data
String
Name of the table to query for min/max values
value_column
String
SQL expression to get min/max values from. When provided with data, queries MIN(value_column) and MAX(value_column) to set the slider range.
min
Number
Minimum value for the slider
max
Number
Maximum value for the slider
step
Number
default:"1"
Step size for the slider
snap_to_step
Boolean
default:"true"
If true, automatically adjusts min/max to align with step boundaries for cleaner numbers (e.g., range 15-103818 with step=10000 becomes 0-110000)
fmt
String
default:"num"
Format code for the slider values (e.g., “num”, “usd”, “pct”). See formatValue documentation for available formats.
range
Boolean
default:"false"
If true, enables range mode with two handles for selecting a min/max range
initial_value
Number | Array
Initial selected value (number for single value, [min, max] array for range mode)
show_input
Boolean
default:"false"
If true, shows a number input next to the slider value for direct editing

Available Filter Properties

When you reference a slider filter in inline queries using the {{filter_id.property}} syntax, the following properties are available:

.value

Returns the numeric slider value (single value) or the selected range [min, max] when in range mode.

.filter

Returns a complete SQL filter expression ready to use in WHERE clauses. For single value: value_column >= value. For range: value_column BETWEEN min AND max. Returns true when no value is selected. Only available when value_column is provided.

.literal

Returns the raw numeric value. Only available in single value mode.

.min

Returns the minimum value of the selected range. Only available when range mode is enabled.

.max

Returns the maximum value of the selected range. Only available when range mode is enabled.

.between

Returns a SQL BETWEEN clause fragment: BETWEEN min AND max. Only available when range mode is enabled. Useful for custom column expressions.