Skip to content

Alaa-Ben/react-native-reanimated2-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A customizable switch powered by reanimated v2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published