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-loading-dots

v1.3.4

Published

A React Native loading component with dots or custom components and smooth animation

Downloads

12,524

Readme

React Native Loading Dots

Smooth dot loading component for your React Native project.

Showcase of React Native Loading Dots

Installation

npm i react-native-loading-dots
yarn add react-native-loading-dots

Usage

import React from "react";
import { View, StyleSheet } from "react-native";
import LoadingDots from "react-native-loading-dots";

function LoadingScreen() {
  return (
    <View style={styles.loadingScreen}>
      <View style={styles.dotsWrapper}>
        <LoadingDots />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  loadingScreen: {
    flex: 1,
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
  },
  dotsWrapper: {
    width: 100,
  },
});

The above code will produce the same outcome as the demo screen capture.

Customization

You can pass a few props to configure the outcome a little:

dots

@type Number
default 4

This prop will change the number of dots that will be displayed in the animation.

colors

@type String[]
default ["#4dabf7", "#3bc9db", "#38d9a9", "#69db7c"]

This prop will change the color of the dots in the given array order. If you declare the array but the length doesn't match with the amount of dots defined, the dot that cannot take a color from this array will instead use a fallback color of "#4dabf7".

size

@type Number
default 20

This prop will control the size of each dot that will be displayed for the animation.

borderRadius

@type Number

This prop will control the border radius of the dots in case you want a specific amount of border radius. If you don't fill this prop it will use a rounded border radius with the formula: size / 2.

bounceHeight

@type Number
default 20

This prop will control the height of the bouncing for the loading dots. The higher the value the higher the will bounce up and down. From 0 to bounceHeight and from 0 to -bounceHeight.

components

@type React.ReactNode[]
default null

This prop will allow you to pass an array of the elements that you'd like to be rendered instead of the colored dots. If you pass components the dots, colors, size and borderRadius props will be ignored.