1.1.0 • Published 2 years ago

react-native-reanimated2-switch v1.1.0

Weekly downloads
-
License
ICS
Repository
github
Last release
2 years ago

Switch

A switch component powered by Reanimated v2. Native animations, color interpolation + supports press and swipe.

npm version downloads

Demo

Reanimated2Switch

Installing

npm i -s react-native-reanimated react-native-reanimated2-switch

Usage

import Switch from "react-native-reanimated2-switch"
<Switch
  activeBackgroundColor='blue' 
  inactiveBackgroundColor='green'
/>

Props

PropTypeDefaultRequiredNote
valueboolfalsefalseInitial switch state
onChangefunction(newValue) => {}falseCallback called when switch value is changed
inactiveBackgroundColorstringgreenfalsebackground color when inactive
activeBackgroundColorstringredfalsebackground color when active
inactiveIconcomponentnullfalseComponent shown in the circle when inactive. Useful for images for example
activeIconcomponentnullfalseComponent shown in the circle when active. Useful for images for example
containerStyleobject{}falseOptional style object for container

Authors

Contribute

Contributions are always welcome! Create a new Pull Request