New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-simple-toggle

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-toggle

Simple React Toogle

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

react-simple-toggle

npm version Simple React Toggle component

Demo

Toggle

Live demo

Getting Started

Installation

npm install react-simple-toggle --save

Usage

Component

import React, { Component } from 'react';
import { Toggle } from 'react-simple-toggle';

class MyComponent extends Component {
	handleChange(checked){
		console.log(checked);
	}

	render(){
		return (
			<div>
				<Toggle
					defaultValue={true}
					onChange={this.handleChange}
				/>
			</div>
		)
	}
}

Options

nametypedefault value
classNamestring'toggle'
defaultValuebooleanfalse
onChangefunctionnull
checkedbooleannull

Style

The styling is completely separated from the component in order to make easy to integrate with the styling of your app. Create your css taking into account this tree:

|-- toggle toggle--checked
    |-- toggle__left
    |-- toggle__center
    |-- toggle__right

Notes:

  • "toggle" can be replaced by className prop
  • toggle--checked is only present when is toggled

However, you can use one of the stylesheets provided in style folder

require('node_modules/react-simple-toggle/style/android.css')

more styles coming soon

FAQs

Package last updated on 22 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts