@react-x/switch
v3.4.1
Published
Cross-platform Switch component for React and React Native.
Downloads
1,480
Maintainers
Readme
@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
import Switch from '@react-x/switch';
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.