Skip to main content

The Slider component for Retool Mobile

A slider to select a number value.

Properties

All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.

disabled

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction > Disabled
MethodsetDisabled()
Default
false
Examples
true

events

A list of configured event handlers that trigger actions or queries.

Type array
Array values object
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers
Array Object Properties

event

The event that triggers the action. Refer to the events section for details of available events for this object.

Type string
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers > Event

method

The JavaScript method to perform when type is datasource, widget, state, or localStorage.

Type string
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers > Edit event handler > Run script actions

type

The type of action to perform.

Type string
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers > Edit event handler > Action
Allowed Values
ValueDescription
datasource

Control query.

widget

Control component.

script

Run script.

state

Set variable.

localStorage

Set localStorage.

util

Perform utility action (e.g., Open URL or Confetti).



hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Hidden
MethodsetHidden()
Default
false
Examples
true

label

The text label to display.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Label > Label
Default
null
Examples
"Label"

labelCaption

Whether to hide the caption displayed with the value.

Type boolean
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Label > Hide output

max

The maximum value to allow.

Type number
Mutability
ControlUsage
Retool UI Inspector > Interaction > Validation rules > Maximum

min

The minimum value to allow.

Type number
Mutability
ControlUsage
Retool UI Inspector > Interaction > Validation rules > Minimum

step

The step value to increment or decrement by.

Type number
Mutability
ControlUsage
Retool UI Inspector

value

The value.

Type number
Mutability Read-only

Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

slider.clearValidation()

Clear the validation message from the input field.

Definition
slider.clearValidation()
Examples

Clear the validation message from slider.

slider.clearValidation();

slider.clearValue()

Clear the current values.

Definition
slider.clearValue()
Examples

Clear the current value of slider.

slider.clearValue();

slider.focus()

Set focus on the input field.

Definition
slider.focus()
Examples

Set focus on slider.

slider.focus();

slider.resetValue()

Reset the current value to the default value.

Definition
slider.resetValue()
Examples

Reset the current value of slider.

slider.resetValue();

slider.setDisabled()

Set the disabled value to toggle whether the input field is disabled. Defaults to true without a parameter.

Definition
slider.setDisabled(disabled)
Parameters

disabled

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Disable slider.

slider.setDisabled(true);

Enable slider.

slider.setDisabled(false);

slider.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
slider.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide slider.

slider.setHidden(true);

Unhide slider.

slider.setHidden(false);

slider.setValue()

Set the current value.

Definition
slider.setValue(value)
Parameters

value

The value.

Type string | number | boolean | object | array

Examples

Set the current value of slider to userValue.

slider.setValue(userValue);

slider.validate()

Validates the value of the input field.

Definition
slider.validate()
Examples

Validate the value of slider.

slider.validate();

Events

Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.

EventDescription
ChangeThe value is changed.