react-native-reanimated2-switch

1.1.0 • Public • Published

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

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

Contribute

Contributions are always welcome! Create a new Pull Request

Package Sidebar

Install

npm i react-native-reanimated2-switch

Weekly Downloads

46

Version

1.1.0

License

ICS

Unpacked Size

42.2 kB

Total Files

5

Last publish

Collaborators

  • alaa-ben