mirror of
https://github.com/gre/gl-react.git
synced 2026-01-18 16:16:59 +00:00
23 lines
496 B
JavaScript
23 lines
496 B
JavaScript
const React = require("react");
|
|
|
|
class Slider extends React.Component {
|
|
render () {
|
|
const { minimumValue, maximumValue, value, onValueChange } = this.props;
|
|
return <input
|
|
type="range"
|
|
min={minimumValue}
|
|
max={maximumValue}
|
|
step={(maximumValue-minimumValue)/1000}
|
|
value={value}
|
|
onChange={e => onValueChange(parseFloat(e.target.value))}
|
|
/>;
|
|
}
|
|
}
|
|
Slider.defaultProps = {
|
|
minimumValue: 0,
|
|
maximumValue: 1,
|
|
value: 0
|
|
};
|
|
|
|
module.exports = Slider;
|