0.9.4 • Published 5 years ago

@whatoplay/react-slider v0.9.4

Weekly downloads
13
License
MIT
Repository
-
Last release
5 years ago

React Slider

A React version of an MDC Slider.

Installation

npm install @whatoplay/react-slider

Usage

Styles

with Sass:

import '@whatoplay/react-slider/index.scss';

with CSS:

import '@whatoplay/react-slider/dist/slider.css';

Javascript Instantiation

import React from 'react';
import Slider from '@whatoplay/react-slider';

class MyApp extends React.Component {
  state = {valueNow: 0};

  render() {
    return (
      <Slider valueMin={0} valueMax={10} valueNow={this.state.valueNow}
        notifyInput={(valueNow) => this.setState({valueNow})}/>
    );
  }
}

Props

Prop NameTypeDescription
classNameStringClasses to be applied to the root element.
notifyInputFunction(valueNow) => voidFires while thumb is moving
notifyChangeFunction(valueNow) => voidFires after moving thumb
valueMinNumberRequired. Mininum value
valueMaxNumberRequired. Maximum value
valueNowNumberRequired. Initial value
disabledBooleandisabled attirbute
stepNumbersteps per move
tabIndexNumbertabindex attribute
dirStringSlider direction