0.0.1 • Published 6 years ago

react-animated-form v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

react-native-animated-form

Animated form for both Android and iOS

Installation

npm install --save react-native-animated-form

Usage

import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    Animated,
    TextInput,
    TouchableOpacity
} from 'react-native';

import AnimatedForm from './animated-form';

const AnimatedInput = Animated.createAnimatedComponent(TextInput);
export default class App extends Component {
    render() {
        return (
            <View style={styles.container}>
                <AnimatedForm delay={100} distance={5}>
                    <AnimatedInput underlineColorAndroid='transparent' style={styles.text} />
                    <AnimatedInput underlineColorAndroid='transparent' style={styles.text} />
                    <AnimatedInput underlineColorAndroid='transparent' style={styles.text} />
                    <AnimatedInput underlineColorAndroid='transparent' style={styles.text} />
                    <AnimatedInput underlineColorAndroid='transparent' style={styles.text} />

                    <Animated.View style={styles.button}>
                        <TouchableOpacity>
                            <Text>Click me</Text>
                        </TouchableOpacity>
                    </Animated.View>
                </AnimatedForm>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#919191',
    },
    text: {
        width: 250,
        height: 35,
        paddingHorizontal: 10,
        marginVertical: 5,
        borderWidth: 1,
        borderRadius: 5,
        borderColor: "#FFF",
        color: "#333",
        backgroundColor: "#FFF",
      },
      button: {
        marginTop: 10,
        backgroundColor: "tomato",
        paddingVertical: 10,
        paddingHorizontal: 5,
        borderRadius: 5,
      },
});

Properties

namedescriptiontypedefault
delay (ms)The delay between components in formNumber100
distanceThe distance that component will moveNumber5

Copyright and License

MIT License

Copyright (c) 2018 maphongba008