Your search did not match any results.



The Slider is a UI component that allows a user to set a numeric value on a continuous range of possible values. Range boundaries of the Slider are specified by the min and max properties. This demo illustrates how to customize the component appearance and how to handle the value change event.

Backend API
Copy to CodePen
window.onload = function () { const value = ko.observable(10); const viewModel = { sliderSimple: { min: 0, max: 100, value: 90, }, sliderWithLabel: { min: 0, max: 100, value: 50, label: { visible: true, format(v) { return `${v}%`; }, position: 'top', }, }, sliderWithTooltip: { min: 0, max: 100, value: 35, rtlEnabled: false, tooltip: { enabled: true, format(v) { return `${v}%`; }, showMode: 'always', position: 'bottom', }, }, sliderWithHideRange: { min: 0, max: 100, value: 20, showRange: false, }, sliderWithStep: { min: 0, max: 100, value: 10, step: 10, tooltip: { enabled: true, }, }, sliderDisabled: { min: 0, max: 100, value: 50, disabled: true, }, eventHandlingOptions: { min: 0, max: 100, value, }, sliderValueOptions: { value, min: 0, max: 100, showSpinButtons: true, }, }; ko.applyBindings(viewModel, document.getElementById('slider-demo')); };
<!DOCTYPE html> <html xmlns=""> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src=""></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <script src=""></script> <link rel="stylesheet" type="text/css" href="" /> <link rel="stylesheet" type="text/css" href="" /> <script src=""></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="slider-demo" class="form"> <div class="dx-fieldset"> <div class="dx-field"> <div class="dx-field-label">Default mode</div> <div class="dx-field-value"> <div data-bind="dxSlider: sliderSimple"></div> </div> </div> <div class="dx-field custom-height-slider"> <div class="dx-field-label">With labels</div> <div class="dx-field-value"> <div data-bind="dxSlider: sliderWithLabel"></div> </div> </div> <div class="dx-field custom-height-slider"> <div class="dx-field-label">With tooltip</div> <div class="dx-field-value"> <div data-bind="dxSlider: sliderWithTooltip"></div> </div> </div> <div class="dx-field"> <div class="dx-field-label">Without range highlighting</div> <div class="dx-field-value"> <div data-bind="dxSlider: sliderWithHideRange"></div> </div> </div> <div class="dx-field"> <div class="dx-field-label">With discrete step</div> <div class="dx-field-value"> <div data-bind="dxSlider: sliderWithStep"></div> </div> </div> <div class="dx-field"> <div class="dx-field-label">Disabled</div> <div class="dx-field-value"> <div data-bind="dxSlider: sliderDisabled"></div> </div> </div> </div> <div class="dx-fieldset"> <div class="dx-fieldset-header">Event Handling and API</div> <div class="dx-field"> <div data-bind="dxSlider: eventHandlingOptions"></div> </div> <div class="dx-field"> <div class="dx-field-label">Slider value</div> <div class="dx-field-value"> <div data-bind="dxNumberBox: sliderValueOptions"></div> </div> </div> </div> </div> </div> </body> </html>
.custom-height-slider { height: 75px; } .dx-field .dx-slider { flex: 1; }