npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-animated-placeholder

v1.0.2

Published

React native animated placeholder for both Android & iOS platforms using react native reanimated.

Downloads

8

Readme

react-native-animated-placeholder

React native animated placeholder for both Android & iOS platforms using react native reanimated.

Installation

npm install react-native-animated-placeholder --save

OR

yarn add react-native-animated-placeholder

Dependencies

react-native-animated-placeholder requires following modules need to be installed as well:

  1. react-native-linear-gradient.
  2. react-native-reanimated.
  3. react-native-gesture-handler.
  4. react-native-redash.

So make sure the above listed modules are installed and configured properly as well.

Supported Props

itemStyle: {} // Defines the style for item.
duration: 800 // Defines the duration for animation. Default is 800.
primaryColor: '#E0E0E0' // Specifies the primary color for the linear gradient. Default is '#E0E0E0'.
secondaryColor: '#F5F5F5' // Specifies the secondary color for the linear gradient. Default is '#F5F5F5'.
animationType: 'overlay' // Specifies the animation type. Supports 'overlay' and 'fade' animations. Default is 'overlay'.

ScreenShots

Animated Placeholder iOS Demo Animated Placeholder Android Demo

Usages Example

  1. First create a new React native project:
react-native init AnimatedPlaceholder
cd AnimatedPlaceholder
yarn add react-native-animated-placeholder
  1. Paste the following code into your App.js file:
import React from 'react';
import {
    StyleSheet,
    View,
    Text,
    Dimensions
} from 'react-native';

import AnimatedPlaceholder from 'react-native-animated-placeholder';

const {
    width
} = Dimensions.get('window');

export default () => {
    return (
        <View style={styles.container}>
            <Text style={styles.title}>Shine Overlay Animation</Text>
            <AnimatedPlaceholder
                itemStyle={styles.imagePlaceholder}
            />

            <AnimatedPlaceholder
                itemStyle={styles.titlePlaceholder}
            />

            <View style={styles.detailsContainer}>
                <AnimatedPlaceholder
                    itemStyle={styles.authorImagePlaceholder}
                />

                <AnimatedPlaceholder
                    itemStyle={[
                        styles.infoPlaceholder,
                        styles.otherStyle
                    ]}
                />

                <AnimatedPlaceholder
                    itemStyle={styles.infoPlaceholder}
                />
            </View>

            <Text style={styles.title}>Fade Animation</Text>
            <AnimatedPlaceholder
                itemStyle={styles.imagePlaceholder}
                animationType='fade'
            />

            <AnimatedPlaceholder
                itemStyle={styles.titlePlaceholder}
                animationType='fade'
            />

            <View style={styles.detailsContainer}>
                <AnimatedPlaceholder
                    itemStyle={styles.authorImagePlaceholder}
                    animationType='fade'
                />

                <AnimatedPlaceholder
                    itemStyle={[
                        styles.infoPlaceholder,
                        styles.otherStyle
                    ]}
                    animationType='fade'
                />

                <AnimatedPlaceholder
                    itemStyle={styles.infoPlaceholder}
                    animationType='fade'
                />
            </View>
        </View>
    )
};

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        paddingHorizontal: width * 5 / 100
    },

    title: {
        fontWeight: 'bold',
        fontSize: width * 5 / 100,
        alignSelf: 'stretch',
        textAlign: 'left',
        marginVertical: width * 3 / 100
    },

    imagePlaceholder: {
        width: '100%',
        height: width * 40 / 100,
        backgroundColor: '#E0E0E0',
        overflow: 'hidden',
        marginBottom: width * 3 / 100
    },

    titlePlaceholder: {
        width: '100%',
        height: width * 9 / 100,
        backgroundColor: '#E0E0E0',
        overflow: 'hidden'
    },

    detailsContainer: {
        flexDirection: 'row',
        justifyContent: 'space-between',
        alignItems: 'center',
        paddingVertical: width * 3 / 100
    },

    authorImagePlaceholder: {
        height: width * 9 / 100,
        width: width * 9 / 100,
        borderRadius: width * 5 / 100,
        overflow: 'hidden',
        backgroundColor: '#E0E0E0'
    },

    infoPlaceholder: {
        flex: 1,
        height: width * 9 / 100,
        backgroundColor: '#E0E0E0',
        overflow: 'hidden'
    },

    otherStyle: {
        marginHorizontal: width * 2.5 / 100
    }
});