1.1.3 • Published 10 years ago

react-toggleswitch v1.1.3

Weekly downloads
69
License
CUBITO
Repository
github
Last release
10 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

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago