1.5.0 • Published 8 years ago

st-react-input-slider v1.5.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

react-input-slider

React input slider component

Installation

npm install react-input-slider --save

Demo

https://wangzuo.github.io/react-input-slider

Usage

var React = require('react');
var InputSlider = require('react-input-slider');

var App = React.createClass({
  getInitialState() {
    return {
      x: 10,
      y: 10
    };
  },

  render() {
    return (
      <InputSlider
        className="slider slider-xy"
        axis='xy'
        x={this.state.x}
        xmax={100}
        y={this.state.y}
        ymax={100}
        onChange={this.handleChange}
      />
    );
  },

  handleChange(pos) {
    this.setState({
      x: pos.x,
      y: pos.y
    });
  }
});

Props

nametypedescriptiondefault
axisstringtype of slider ('x', 'y', 'xy')'x'
xnumbervalue of x
xmaxnumbermax of x
xminnumbermin of x0
ynumbervalue of y
ymaxnumbermax of y
yminnumbermin of y0
onChangefunctionchange callbacknull
onDragEndfunctiondragEnd callbacknull

License

MIT