sts

swipe-toggle-switch

ReactJs swipe toggle switch

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

swipe-toggle-switch

This is small and simple toggle switch component for reactjs framework.

NOTE: this library is distributed ONLY as commonjs module. It does not export component in global namespace and never will!

Animated

Install and use

npm install swipe-toggle-switch

than in your react component:

import SwipeToggleSwitch from './../build/swipe-toggle-switch.js';

and in the render method of your component

  <SwipeToggleSwitch value={ this.state.lightIsOn } caption='Light' 
    offStateText='Off' onStateText='On' onToggle={this.onSwitchToggle}/>

Properties

  • value - initial value (Boolean)
  • caption - text on a switch lever (String)
  • offStateText - text do display when state is off (String)
  • onStateText - text do display when state is on (String)

Methods

  • onToggle - handler to be called every time, user toggle a switch. It has 2 parameters: event and newValue

Run example

NOTE: To run an example localy you need to have a webpack.

  1. git clone https://github.com/AndrewKovalenko/swipe-toggle-switch.git
  2. cd swipe-toggle-switch
  3. npm i
  4. npm run build
  5. npm run build-example
  6. Open ./example/index.html in your browser or run open example/index.html if you are on Mac

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100