react-native-animated-checbox
v1.0.4
Published
An animated checkbox component for react native
Downloads
9
Readme
react-native-animated-checkbox
An animated checkbox component for react native
Install
npm i react-native-animated-checkbox
Lottie
This library depends on lottie-react-native
to run the animations. How to install lottie for react native
Usage
import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';
import AnimatedCheckbox from 'react-native-animated-checbox';
import Anim from './assets/notification.json';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
checked: false
};
}
render() {
return (
<View style={styles.container}>
<View style={{ width: 250, height: 250 }}>
<AnimatedCheckbox
Anim={Anim}
width={250}
height={250}
checked={this.state.checked}
onPress={() => this.setState({ checked: !this.state.checked })}
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
}
});