1.0.2 • Published 4 years ago

canducci-switch v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Canducci Switch Checkbox

NPM JavaScript Style Guide npm Node.js CI npm bundle size

Install

npm install --save canducci-switch

Usage

import React, { Component } from 'react'

import CanducciSwitch, { Size } from 'canducci-switch'

class Example extends Component {
  const [value, setValue] = useState<boolean>(true)
  render() {
    return (
      <div>
        <div>
          <CanducciSwitch
            defaultChecked={value}
            onChange={() => setValue(!value)}
            size={Size.Medium}
          />
        </div>
        <div>
          <CanducciSwitch
            defaultChecked={value}
            onChange={() => setValue(!value)}
            size={Size.Medium}
            round            
          />
        </div>
      </div>
    )
  }
}

Ouput

output

API

PropTypeDefault
roundboolfalse
sizeenummedium
backgroundColorOnstring'#2196f3'
backgroundColorOffstring'#cccccc'
cicleColorstring'#ffffff'
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago