0.0.7 • Published 6 years ago

react-native-animated-form v0.0.7

Weekly downloads
4
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

Demo

npm.io

Usage

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

import AnimatedForm from 'react-native-animated-form';
import Background from './bg.jpg';

const AnimatedInput = Animated.createAnimatedComponent(TextInput);
export default class App extends Component {
    render() {
        return (
            <View style={styles.container}>
                <Image style={[StyleSheet.absoluteFill, {width: null, height: null}]} source={Background} />
                <AnimatedForm delay={100} distance={5}>
                    <AnimatedInput placeholder='User name' underlineColorAndroid='transparent' style={styles.text} />
                    <AnimatedInput placeholder='Email' underlineColorAndroid='transparent' style={styles.text} />
                    <AnimatedInput placeholder='Password' underlineColorAndroid='transparent' style={styles.text} />
                    <AnimatedInput placeholder='Confirm password' underlineColorAndroid='transparent' style={styles.text} />

                    <Animated.View style={styles.buttonView}>
                        <TouchableOpacity style={styles.button}>
                            <Text style={{color: '#fff'}}>Register</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",
      },
      buttonView: {
        height: 40,
        marginTop: 10,
        backgroundColor: "tomato",
        paddingVertical: 10,
        paddingHorizontal: 5,
        borderRadius: 5,
      },
      button: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center'
      }
});

Properties

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

Warning

All component in AnimatedForm must be animated.

Copyright and License

MIT License

Copyright (c) 2018 maphongba008

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.1

6 years ago