import React from 'react'; import { Row, Col, Table, Container, CustomInput } from './../../../components'; import Toggle from 'react-toggle'; import { HeaderMain } from "../../components/HeaderMain"; import { HeaderDemo } from "../../components/HeaderDemo"; import classes from './Toggles.scss'; export class Toggles extends React.Component { state = { baconIsReady: true, cheeseIsReady: false, biscuitIsReady: false, eggsAreReady: false, milkIsReady: false, toastIsReady: false, soupIsReady: true, tofuIsReady: false } render() { return (

An elegant, accessible toggle component for React. Also a glorified checkbox.

Switch Name Switch Example
{ this.setState({ milkIsReady: !this.state.milkIsReady }) } } label="Controlled Component" /> { this.setState({ milkIsReady: !this.state.milkIsReady }) } }/>
{ this.setState({ toastIsReady: !this.state.toastIsReady }) } } label="Controlled Component without onChange" />
Diabled, Unchecked
Disabled, Checked
Custom className
Custom Icons , unchecked: null, }} onChange={ () => { this.setState({ soupIsReady: !this.state.soupIsReady }) } } />
No Icons { this.setState({ tofuIsReady: !this.state.tofuIsReady }) }} />
Switch Example
{ this.setState({cheeseIsReady: !this.state.cheeseIsReady}) } } />
{ this.setState({biscuitIsReady: !this.state.biscuitIsReady}) } } /> Adjacent label, but not standard tag
{ this.setState({eggsAreReady: !this.state.eggsAreReady}) } } /> No label tag
); } }