Skip to main content

Slider

Rocket 2.0

The Slider component lets the user pick a number, or a range between two numbers, by dragging a handle along a track. Use it for filters such as a price range, a discount or a score threshold.

Properties​

Property
Description
Expected Value
LabelText shown above the slider.Text. Default: Label
Help textHint text shown under the slider.Text
MinimumLowest value the slider can reach.Number. Default: 0
MaximumHighest value the slider can reach.Number. Default: 100
StepAmount the value changes by as the handle moves.Number. Default: 1
RangeShows two handles so the user picks a start and an end value.On or off. Default: Off
Default value (number, or [start, end] for a range)Value when the app loads: a number, or [start, end] for a range. A range with a single number starts at Minimum and Maximum.Number. Default: 50
Show valueShows the current value next to the label, such as Label: 50 or Label: 20 to 80.On or off. Default: On

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On changeTriggers when the user releases a handle after moving it.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set valueMoves the slider to the given Value. On a range, it sets the start.components.slider1.setValue("")
Set range valueSets a range to the given Start and End values.components.slider1.setRangeValue("", "")
ResetMoves the slider back to Default value without firing On change.components.slider1.reset()
Set visibilityShows the component when true, hides it when false.components.slider1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.slider1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.slider1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
labelText shown above the slider.{{components.slider1.label}}
descriptionHint text shown under the slider.{{components.slider1.description}}
minLowest value the slider can reach.{{components.slider1.min}}
maxHighest value the slider can reach.{{components.slider1.max}}
stepAmount the value changes by as the handle moves.{{components.slider1.step}}
rangeShows two handles so the user picks a start and an end value.{{components.slider1.range}}
defaultValueValue when the app loads: a number, or [start, end] for a range. A range with a single number starts at Minimum and Maximum.{{components.slider1.defaultValue}}
showValueShows the current value next to the label, such as Label: 50 or Label: 20 to 80.{{components.slider1.showValue}}
valueThe selected number, or [start, end] for a range.{{components.slider1.value}}
isVisibleWhether the component is visible.{{components.slider1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.slider1.isLoading}}
isDisabledWhether the component is disabled.{{components.slider1.isDisabled}}

Styles​

Style
Default
Range and handle colorTheme: Brand primary
Label colorTheme: Primary text
Help text colorTheme: Placeholder text
Track colorTheme: Brand primary
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.