react-animated-form

0.0.1 • Public • Published

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

name description type default
delay (ms) The delay between components in form Number 100
distance The distance that component will move Number 5

Copyright and License

MIT License

Copyright (c) 2018 maphongba008

Package Sidebar

Install

npm i react-animated-form

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

4.94 kB

Total Files

3

Last publish

Collaborators

  • aaron_ta