npm.io
4.0.5 • Published 7 years ago

react-slider-simple

Licence
ISC
Version
4.0.5
Deps
1
Size
303 kB
Vulns
0
Weekly
0
Stars
3

react-slider-simple

Install:

yarn add react-slider-simple

or

npm install --save react-slider-simple


Usage:

class App extends Component {
  render() {
    return (
        <Slider
          rounded={false}
        />
    );
  }
}

sliding

import React, { Component } from 'react';
import Slider from 'react-slider-simple';

export default class SliderComp extends Component {
  state  = {
    percent: 30,
  }

  onChange = (percent) => {
    console.log(percent);
    this.setState({ percent });
  }
  onDone = (percent) => {
    console.log(`I'm done. here's the percent: ${percent}%`);
  };

  render() {
    const { percent } = this.state;
    return (
        <Slider
          value={percent}
          onChange={this.onChange}
          onDone={this.onDone}
          thumbColor="rgb(219, 112, 147)"
          shadowColor="rgb(219, 112, 100)"
          sliderPathColor="rgb(119, 12, 47)"
        />
    );
  }
}

sliding

Properties:

Property Description Type Defaults
onDone returns % of slider position function -
onChange returns % of slider position function -
value value of slider number 0
defaultValue default value of slider number 0
displayThumb Always show thumb boolean true
rounded rounded corners boolean true
thumbColor The color of thumb string -
shadowColor The color of shadow string -
sliderPathColor The color of path string -

Keywords