react-jpc-toggle-btn
v1.0.7
Published
Toggle button (on, off) for react native
Downloads
5
Readme
Toggle button for react native
Usage
Install with npm
npm install react-jpc-toggle-btn
In your project
Import the library
import ToggleBtn from 'react-jpc-toggle-btn'
You can use it in anywhere
<ToggleBtn onLabel="ON" offLabel="OFF" offColor="#ccc" onColor="#6eddd9" />
By adding the onPress attribut you can get the button status
getToggleStatus = (state) => {
console.log(state)
}
Full example
<ToggleBtn onPress={this.getToggleStatus} onLabel="ON" offLabel="OFF" offColor="#ccc" onColor="#6eddd9" />
License
MIT