1.1.3 • Published 8 years ago

react-toggleswitch v1.1.3

Weekly downloads
69
License
CUBITO
Repository
github
Last release
8 years ago

######################## Author - "Deep Prakash" ########################

React Toggle Switch

A full customizable Toggle switch. No Jquery.

Install

npm install react-toggleswitch --save

Usage

var Switch = require("react-toggleswitch");

React.render(<Switch />, document.getElementById("myApp"));

Options

  1. onValue
  2. offValue
  3. width
  4. onChange
  5. background
  6. toggleColor

Descriptions

  1. onValue - Display value for ON state.

    ```
    <Switch onValue = "ON"/>
    ```
  2. offValue - Display value for OFF state.

    ```
    <Switch offValue = "OFF"/>
    ```
  3. width - Width of the switch.

    ```
    <Switch width = "140"/>
    ```
  4. onChange - Function for handling switch toggle.

    ```
    <Switch onChange = {this.toggle} />
    ```
    
    ```
    toggle:function(val){
    	if(val == "ON"){
    		/*
    			Do something you need to do if switch is on
    		*/	
    	}
    	if(val == "OFF"){
    		/*
    			Do something you need to do if switch is off
    		*/	
    	}
    }
    ```
  5. background - Set switch background color.

    ```
    <Switch background = "#16a085"/>
    ```
  6. toggleColor - Set switch toggle button color.

    ```
    <Switch toggleColor = "#34495e" />
    ```
1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago