DevExtreme v23.1 is now available.
Explore our newest features/capabilities and share your thoughts with us.
This demo shows how you can create and configure a Slider.
To create a Slider, declare it in markup and use the min and max properties to limit the range of accepted values.
You can also specify the value property to change the initial value.
The Default mode section shows a Slider with such a basic setup.
The Slider can display labels for the min and max values. To configure the labels, use the label object. In this object, specify the visible, position, and format properties.
To display a handle tooltip, you need to configure the tooltip object:
Set the enabled property to true
to display a tooltip.
Specify the tooltip position: over or under the Slider.
Specify the format property.
Assign 'onHover' or 'always' to the showMode property to change how the component shows a tooltip.
Use the showRange property to specify if the component should highlight the range between min and value.
Use the step property to specify the value change step for the Slider.
If you want to disable the Slider, set the disabled property to true
.
Specify the onValueChanged function to handle the value change. In this demo, the NumberBox component and the Sliders use this function to exchange values.
The valueChangeMode property allows you to choose when the Slider changes its value. Available modes include onHandleMove
and onHandleRelease
. You can see the property's effect in the Process Value Changes section. The first Slider changes its value while a user slides the handle. The second Slider changes its value only after the user releases the handle. These Slider values are synchronized.