kodobe-react-switch
v2.0.1
Published
Kodobe React Switch
Downloads
2
Readme
Kodobe React Switch
This is a simple react switch package.
Install
npm install kodobe-react-switch
or
yarn add kodobe-react-switch
Setup
import Switch from 'kodobe-react-switch';
Usage
import Switch from "kodobe-react-switch";
function App() {
return (
<div>
<h3>Here is how to use a switch</h3>
<Switch
disabled
isActive={true}
onSwitch={(t) => console.log(t)}
/>
</div>
);
}
Options
- isActive : state of the switch (boolean, default=false)
- disabled : if the switch can be toggled (boolean, default=false)
- onSwitch : get's alternate state of isActive (function)
- style : (object)
- className : (string)