/* eslint react/no-multi-comp: 0 */ require('rc-slider/assets/index.less'); const React = require('react'); const ReactDOM = require('react-dom'); const Slider = require('rc-slider'); const style = {width: 400, margin: 50}; function log(value) { console.log(value); } const CustomizedRange = React.createClass({ getInitialState: function() { return { lowerBound: 20, upperBound: 40, value: [20, 40], }; }, onLowerBoundChange: function(e) { this.setState({ lowerBound: +e.target.value }); }, onUpperBoundChange: function(e) { this.setState({ upperBound: +e.target.value }); }, onSliderChange: function(value) { log(value); this.setState({ value: value, }); }, handleApply: function() { const { lowerBound, upperBound } = this.state; this.setState({ value: [lowerBound, upperBound]}); }, render: function() { return (
Basic Range,`allowCross=false`
Basic Range,`step=20`
Basic Range,`step=20, dots`
Controlled Range
Customized Range
Range with dynamic `max` `min`