1.1.0 • Published 3 years ago
react-native-reanimated2-switch v1.1.0
Switch
A switch component powered by Reanimated v2. Native animations, color interpolation + supports press and swipe.
Demo

Installing
npm i -s react-native-reanimated react-native-reanimated2-switchUsage
import Switch from "react-native-reanimated2-switch"<Switch
activeBackgroundColor='blue'
inactiveBackgroundColor='green'
/>Props
| Prop | Type | Default | Required | Note |
|---|---|---|---|---|
| value | bool | false | false | Initial switch state |
| onChange | function | (newValue) => {} | false | Callback called when switch value is changed |
| inactiveBackgroundColor | string | green | false | background color when inactive |
| activeBackgroundColor | string | red | false | background color when active |
| inactiveIcon | component | null | false | Component shown in the circle when inactive. Useful for images for example |
| activeIcon | component | null | false | Component shown in the circle when active. Useful for images for example |
| containerStyle | object | {} | false | Optional style object for container |
Authors
- Alaa Ben El Ahmar - Alaa-Ben
Contribute
Contributions are always welcome! Create a new Pull Request