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-loaders-kit

v0.1.3

Published

A robust collection of loaders for React.js

Downloads

766

Readme

React Loaders Kit

npm version license

A simple yet robust and comprehensive collection of loading animations made with React.js based on inspiration from designers and developers on codepen.

This package was made using the Emotion css library.

Demo Page

All loaders can be found on the demo page

Installation

With npm:

npm install --save react-loaders-kit

With Yarn:

yarn add react-loaders-kit

Usage

All loaders come with their own default properties. You have the option to overwrite these properties by passing in your own props into the loaders.

IMPORTANT: All loaders accept a loading prop as a boolean that is required. Without passing the loading prop, an error is thrown. The loader will render none if loading is false.

Example

import React, {useState} from "react";
import { BarsLoader } from 'react-loaders-kit';

//or

import BarsLoader from 'react-loaders-kit/lib/bars/BarsLoader'; // Recommended to reduce bundle size

const MyWonderfulComponent = () => {
    const [loading, setLoading] = useState(true);

    const loaderProps = {
        loading,
        size: 35,
        duration: 1,
        colors: ['#5e22f0', '#f6b93b']
    }

    return (
        <BarsLoader {...loaderProps} />
    )
}

Available Loaders, PropTypes, and Default Values

Common default props for all loaders:

loading: true;
pause: false;

IMPORTANT: The loading prop is REQUIRED and needs to be passed for the loader to display.

pause props

All loaders accept a pause prop which is a boolean. If pause is true, the animation is paused else it deafults to playing.

color & colors props

Some loaders accept a color prop which is a color hash string in the format of #XXXXXX or #XXX.

Other loaders which have more customization accept a colors prop which is a string array of colors in the format of ['#XXXXXX', '#XXXXXX', ...] or ['#XXX', '#XXX', ...].

All loaders

The tables below contain the default values of each prop on all loaders.

<AlternatingOrbitsLoader />

| size: number | colors: string[] | | -------------|----------------------| | 50 |['#5e22f0', '#f6b93b']|

<AtomLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 50 |['#5e22f0', '#5e22f0']| 1 |

<BarsLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 35 |['#5e22f0', '#f6b93b']| 1 |

<BarsLoader2 />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 1.5 |

<BatteryLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 50 |'#5e22f0' | 0.7 |

<BlobLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 1.3 |

<BlurrySquareLoader />

| boxNumber: number | colors: string[] | duration: number | | ------------------|---------------------------------|----------------------| | 3 |['#5e22f0', '#5e22f0', '#5e22f0']| 0.7 |

NOTE: The number of boxes must correspond to the number of colors in the array

<BouncyBallsLoader />

| size: number | colors: string[] | duration: number | | ------------------|---------------------------------|----------------------| | 40 |['#5e22f0', '#5e22f0', '#5e22f0']| 0.4 |

<BrokenCirclesLoader />

| size: number | colors: string[] | | ------------------|--------------------------------------------| | 40 |['#5e22f0', '#5e22f0', '#5e22f0', '#5e22f0']|

<CircleFadeLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 0.5 |

<CirclePopLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 120 |'#5e22f0' | 1 |

<ClockLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 40 |['#5e22f0', '#5e22f0']| 1 |

<DotsLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 45 |'#5e22f0' | 2 |

<DoubleSquareLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 30 |['#5e22f0', '#5e22f0']| 2.5 |

<DrawWaveLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 50 |'#5e22f0' | 0.8 |

<DyingLightLoader />

| size: number | colors: string[] | | ------------------|---------------------------------| | 35 |['#5e22f0', '#5e22f0', '#5e22f0']|

<EightBitLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 60 |'#5e22f0' | 1 |

<ElasticCircleLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 1 |

<FillCircleLoader />

| size: number | colors: string[] | | ------------------|----------------------| | 60 |['#5e22f0', '#5e22f0']|

<FillSquareLoader />

| size: number | colors: string[] | duration: number | | ------------------|--------------------------------------------|----------------------| | 40 |['#5e22f0', '#5e22f0', '#5e22f0', '#5e22f0']| 1 |

<FlipLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 45 |'#5e22f0' | 1 |

<FlippingCubeLoader />

| size: number | colors: string[] | | ------------------|--------------------------------------------| | 35 |['#5e22f0', '#5e22f0', '#5e22f0', '#5e22f0']|

<GooeyLoader1 />

| size: number | color: string | | ------------------|----------------------| | 60 |'#5e22f0' |

<GooeyLoader2 />

| size: number | color: string | | ------------------|----------------------| | 60 |'#5e22f0' |

<GooeyCircleLoader />

| size: number | colors: string[] | | ------------------|---------------------------------| | 80 |['#f6b93b', '#5e22f0', '#ef5777']|

<HelixLoader />

| numberOfDots: number | numberOfDots: number | colors: string[] | duration: number | | ---------------------| ---------------------|---------------------------------|----------------------| | 90 | 10 |['#5e22f0', '#f6b93b'] | 1.5 |

<HydrogenLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 45 |['#5e22f0', '#5e22f0']| 0.6 |

<HypnosisLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 50 |['#ffffff', '#5e22f0']| 2 |

<BlurrySquareLoader />

| size: number | jellyNumber: number | colors: string[] | duration: number | | -------------| --------------------|-------------------------------------------------------|----------------------| | 150 | 5 |['#5e22f0', '#5e22f0', '#5e22f0', '#5e22f0', '#5e22f0']| 0.6 |

NOTE: The number of jellies must correspond to the number of colors in the array

<KissyBallsLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 60 |['#5e22f0', '#5e22f0']| 0.5 |

<LineLoader />

| lineWidth: number | color: string | duration: number | | ------------------|----------------------|----------------------| | 25 |'#5e22f0' | 2 |

<LinneardLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 130 |['#5e22f0', '#ef5777']| 0.8 |

<LiquidLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 2 |

<MovingSquareLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 60 |['#5e22f0', '#5e22f0']| 1 |

<NotepadLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 40 |['#5e22f0', '#5e22f0']| 2 |

<PingPongLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 90 |['#5e22f0', '#5e22f0']| 0.8 |

<PipLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 15 |'#5e22f0' | 0.8 |

<PulseBubbleLoader />

| size: number | colors: string[] | | ------------------|---------------------------------| | 55 |['#5e22f0', '#5e22f0', '#5e22f0']|

<RotatingBoxesLoader />

| size: number | boxBorderWidth: number | colors: string[] | duration: number | | -------------| -----------------------|--------------------------------------------|----------------------| | 10 | 2 |['#ffffff', '#ffffff', '#5e22f0', '#5e22f0']| 3 |

<RotatingCircleLoader />

| size: number | colors: string[] | duration: number | | ------------------|--------------------------------------------|----------------------| | 20 |['#5e22f0', '#5e22f0', '#f6b93b', '#ef5777']| 1.2 |

<SlicesLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 80 |'#5e22f0' | 1 |

<SlidingCubeLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 10 |['#5e22f0', '#5e22f0']| 1 |

<SphereLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 1 |

<SpinningCircleLoader />

| size: number | colors: string[] | | ------------------|----------------------| | 50 |['#5e22f0', '#ffffff']|

<SpinningOrbitLoader />

| size: number | colors: string[] | | ------------------|--------------------------------------------| | 50 |['#5e22f0', '#5e22f0', '#5e22f0', '#5e22f0']|

<SwingingCubeLoader />

| size: number | colors: string[] | duration: number | | -------------|---------------------------------|----------------------| | 18 |['#5e22f0', '#5e22f0', '#5e22f0']| 1 |

<SwitchingCubeLoader />

| size: number | colors: string[] | duration: number | | -------------|---------------------------------|----------------------| | 20 |['#5e22f0', '#5e22f0', '#5e22f0']| 1 |

<TextureLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 0.7 |

<VolumeLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 35 |['#5e22f0', '#ffffff']| 0.6 |

<VortexLoader />

| size: number | colors: string[] | duration: number | | -------------|----------------------|----------------------| | 40 |['#5e22f0', '#5e22f0']| 2 |

<WaveLoader />

| size: number | color: string | duration: number | | -------------|----------------------|----------------------| | 40 |'#5e22f0' | 0.6 |

Contributing

  • Pull requests and ⭐ stars are always welcome
  • For bugs and feature requests, please create an issue

License

MIT