canducci-switch
v1.0.2
Published
Canducci Switch Checkbox
Downloads
3
Maintainers
Readme
Canducci Switch Checkbox
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
API
| Prop | Type | Default | | --- | --- | --- | | round | bool | false | | size | enum | medium | | backgroundColorOn | string | '#2196f3' | | backgroundColorOff | string | '#cccccc' | | cicleColor | string | '#ffffff' |