react-slider-simple

4.0.5 • Public • Published

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 -

Package Sidebar

Install

npm i react-slider-simple

Weekly Downloads

14

Version

4.0.5

License

ISC

Unpacked Size

310 kB

Total Files

11

Last publish

Collaborators

  • kallebalik