react-x-switch
Cross-platform Switch component for React and React Native.
Getting Started
Install react-x-switch
using yarn
:
yarn add react-x-switch
Usage
;
Props
Prop | Type | Required | Description |
---|---|---|---|
isOn |
boolean | yes | Whether or not the switch is on or off. |
onChange |
function | no | Callback triggered when the switch is toggled. |
onTintColor |
string | no | The color the switch should be when turned on. |
thumbTintColor |
string | no | The color of the tappable part of the switch. |
tintColor |
string | no | The color the switch should be when turned off. |
isDisabled |
boolean | no | Whether or not this switch is togglable. |
Contributing
If you have any ideas on how this module could be better, create an Issue or submit a PR.