Animated Switch Button For React Native

An animated and highly customizable on/off switch button component for React Native.

How to use it:

1. Install and import the switch-button.

# NPM
$ npm i @freakycoder/react-native-switch-button --save

import SwitchButton from "@freakycoder/react-native-switch-button";

2. Add the switch-button component to the app and specify the path to inactive/active images as follows:

<SwitchButton
  text="ReactScript"
  inactiveImageSource={require("inactive.png")}
  activeImageSource={require("active.png")}
  onPress={(isActive: boolean) => console.log(isActive)}
/>

3. All default component props.

style?: CustomStyleProp;
textStyle?: CustomTextStyleProp;
imageStyle?: CustomImageStyleProp;
textContainerStyle?: CustomTextStyleProp;
activeImageSource: ImageSourcePropType;
inactiveImageSource: ImageSourcePropType;
text?: string;
mainColor?: string;
tintColor?: string;
disableText?: boolean;
originalColor?: string;
onPress: (isActive: boolean) => void;

Preview:

Animated Switch Button For React Native

Download Details:

Author: WrathChaos

Live Demo: View The Demo

Download Link: Download The Source Code

Official Website: https://github.com/WrathChaos/react-native-switch-button

License: MIT

You Might Be Interested In:

Tags:

Add Comment