2.1.17 • Published 8 years ago
react-stateless-switcher v2.1.17
react-stateless-switcher
React Switcher is a clear lightweight and customizable library for react application.
Stateless, sure.
Install
Just run
npm i react-stateless-switcherUsing
and import Switcher component to your application
import Switcher from 'react-stateless-switcher';So it`s time to use it
<Switcher
value={this.state.value}
onChange={(value) => this.setState({value})}/>Features

react-stateless-switcher - is a simple library. That`s mean you should add your own CSS styles. I hope you can.
react-stateless-switcher supports TypeScript/any version of React
Component adds a hidden input that have a value true/false/undefined. It depend on user choice.
If you need tripple positioned switcher, just set a nullable property to true.
List of properties
| Property | Type | Details |
|---|---|---|
| id | string | optional |
| name | string | optional |
| value | boolean or undefined | determines the position of switcher |
| onChange | void | new value is an argument |
| className | string | optional |
| disabled | boolean | optional |
| nullable | boolean | optional |