React Loaders Kit

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 />
<AtomLoader />
<BarsLoader />
<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 />
NOTE: The number of boxes must correspond to the number of colors in the array
<BouncyBallsLoader />
<BrokenCirclesLoader />
<CircleFadeLoader />
| size: number | color: string | duration: number |
|---|
| 40 | '#5e22f0' | 0.5 |
<CirclePopLoader />
| size: number | color: string | duration: number |
|---|
| 120 | '#5e22f0' | 1 |
<ClockLoader />
<DotsLoader />
| size: number | color: string | duration: number |
|---|
| 45 | '#5e22f0' | 2 |
<DoubleSquareLoader />
<DrawWaveLoader />
| size: number | color: string | duration: number |
|---|
| 50 | '#5e22f0' | 0.8 |
<DyingLightLoader />
<EightBitLoader />
| size: number | color: string | duration: number |
|---|
| 60 | '#5e22f0' | 1 |
<ElasticCircleLoader />
| size: number | color: string | duration: number |
|---|
| 40 | '#5e22f0' | 1 |
<FillCircleLoader />
<FillSquareLoader />
<FlipLoader />
| size: number | color: string | duration: number |
|---|
| 45 | '#5e22f0' | 1 |
<FlippingCubeLoader />
<GooeyLoader1 />
| size: number | color: string |
|---|
| 60 | '#5e22f0' |
<GooeyLoader2 />
| size: number | color: string |
|---|
| 60 | '#5e22f0' |
<GooeyCircleLoader />
<HelixLoader />
<HydrogenLoader />
<HypnosisLoader />
<BlurrySquareLoader />
NOTE: The number of jellies must correspond to the number of colors in the array
<KissyBallsLoader />
<LineLoader />
| lineWidth: number | color: string | duration: number |
|---|
| 25 | '#5e22f0' | 2 |
<LinneardLoader />
<LiquidLoader />
| size: number | color: string | duration: number |
|---|
| 40 | '#5e22f0' | 2 |
<MovingSquareLoader />
<NotepadLoader />
<PingPongLoader />
<PipLoader />
| size: number | color: string | duration: number |
|---|
| 15 | '#5e22f0' | 0.8 |
<PulseBubbleLoader />
<RotatingBoxesLoader />
<RotatingCircleLoader />
<SlicesLoader />
| size: number | color: string | duration: number |
|---|
| 80 | '#5e22f0' | 1 |
<SlidingCubeLoader />
<SphereLoader />
| size: number | color: string | duration: number |
|---|
| 40 | '#5e22f0' | 1 |
<SpinningCircleLoader />
<SpinningOrbitLoader />
<SwingingCubeLoader />
<SwitchingCubeLoader />
<TextureLoader />
| size: number | color: string | duration: number |
|---|
| 40 | '#5e22f0' | 0.7 |
<VolumeLoader />
<VortexLoader />
<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