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-scene-loader

v0.2.0

Published

Provides full-screen loader component with some animations

Downloads

31

Readme

Installation

npm i react-native-scene-loader

How it looks like

Fade animation

Alt text

Top animation

Alt text

Usage

Put SceneLoader in the end of your scene, or root view, to overlap other components.

Most basic example without animation.

    <SceneLoader
        visible={this.state.loading}
    />

You may use some basic animations

    <SceneLoader
        visible={this.state.loading}
        animation={{
            fade: {timing: {duration: 1000, easing: Easing.circle}}
        }}
    />

Or/and custom loaders/underlays

    <SceneLoader
        visible={this.state.loading}
        animation={{top: {spring: {bounciness: 15}}}}
        customUnderlay={(style) => {
            return (
                <Image
                    style={style}
                    source={require('./assets/bg.jpg')}
                    resizeMode="stretch"
                />
            )
        }}
        customIndicator={() => {
            return (
                <Image
                    style={{width: wWidth/2.5, height: wWidth/2.5}}
                    source={require('./assets/loader.png')}
                    resizeMode="contain"
                />
            )
        }}
    />

Props

visible

Whether loader is visible. Only this is required for component to work.

underlayColor

If you're not using customUnderlay you may want to change underlay color. For example "rgba(64, 64, 128, 0.5)"

indicatorProps

If you did not specify customIndicator ActivityIndicator with this props will be used.

animation

Currently supported - fade, bot, top, left, right. First one will fade loader in or out. Others will pull loader from either direction.

Animation prop consists of animation name, animation type and its options.

Types are default react-native animation types 'timing', 'spring', 'decay' (https://facebook.github.io/react-native/docs/animated.html#methods).

Options are options of corresponding animation type.

Example:

    ...
    animation={{
        bot: {timing: {duration: 500, easing: Easing.out}}
    }}
    ...

What example does: move loader from bot to center using 'Animated.timing' in 500ms.

Currently only one animation name and type can be used at a time.

customIndicator

Function that provides loader with your custom indicator component.

customUnderlay

Function that provides loader with your custom underlay component.

Important: The function will receive "style" argument, which you need to pass to your underlay for it to take the whole screen.

callbacks

Called if you use an animation.

onInAnimationStart - Entering animation started

onInAnimationEnd - Entering animation ended

onOutAnimationStart - Exiting animation started

onOutAnimationEnd - Exiting animation ended

Examples

cd example
npm i
react-native run-android/run-ios

Basically everything is in example/index.js