DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Slider

This demo shows how you can create and configure a Slider.

DevExtreme Accessibility Compliance
DevExtreme component libraries meet a variety of WCAG and Section 508 compliance standards. To assess this demo’s accessibility level, click the Run AXE® Validation button to launch the AXE® web accessibility evaluation tool.
All trademarks or registered trademarks are property of their respective owners. AXE® Terms of Use
The overall accessibility level of your application depends on the Slider features used.
To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
Backend API

Create 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.

Customize Slider Appearance

Max and min labels

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.

Tooltip

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.

Range highlight

Use the showRange property to specify if the component should highlight the range between min and value.

Discrete step

Use the step property to specify the value change step for the Slider.

Disabled state

If you want to disable the Slider, set the disabled property to true.

Handle the Value Change Event

Specify the onValueChanged function to handle the value change. In this demo, the NumberBox component and the Sliders exchange values through the variable bound to all the components. The state of this variable changes in the onValueChanged function.

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.