Skip to content

baooab/react-native-animated-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

react-native-animated-switch

Lightweight switch implementation for Android and iOS.

Demo

url: https://snack.expo.io/@zhangbao90s/animated-switch-v3

React Native Animated Switch

Install

Just copy AnimatedSwitch.tsx's code from demo above to your project.

Usage

import AnimatedSwitch from './AnimatedSwitch';

<AnimatedSwitch value={false} onValueChange={(value) => console.log(value)} />;

Props

Prop Type Optional Default value Description
value Boolean false Default state.
onValueChange Function false Trigger after switch state is changed.
width Number true 54 Switch width.
height Number true 30 Switch height.
onColor String true dodgerblue Active color.
offColor String true lightgray Inactive color.

License

MIT

About

Lightweight switch implementation for Android and iOS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published