Controlled Slider

By default, the Slider is in an uncontrolled state.

To manage the state of the Slider:

  1. Use its value property.
  2. Handle the onChange event.
  3. Pass the new value through the props.
import * as React from 'react';
import * as ReactDOM from 'react-dom';

import { Slider, SliderLabel } from '@progress/kendo-react-inputs';

class App extends React.Component {
    state = { value: 7 };
    onChange = event => this.setState({ value: event.value });

    render() {
        return (
            <Slider
                min={1}
                max={10}
                step={1}
                value={this.state.value}
                onChange={this.onChange}
            >
                {[ 1, 3, 5, 6, 10 ].map(value => (
                    <SliderLabel
                        key={value}
                        position={value}
                        onClick={() => { this.setState({ value }); }}
                    />
                ))}
            </Slider>
        );
    }
}

ReactDOM.render(<App />, document.querySelector('my-app'));
In this article
 /