0.4.0 • Published 6 years ago

react-loaders-spinners v0.4.0

Weekly downloads
103
License
MIT
Repository
github
Last release
6 years ago

React Loaders Spinners

A component-based loaders/spinners React library, built with styled-components.

Demo - check out and play around with the examples here.

Why should you use this?

If you need highly customizable loader(s) or spinner(s) in your React project.

Getting started

yarn add react-loaders-spinners

or

npm i react-loaders-spinners

Note that react-loaders-spinners lists styled-components as a peerDependency, therefore it expects you to have styled-components already installed in your project.

import React from 'react';
import { BounceyLoader } from 'react-loaders-spinners';

const App = () => (
  <BounceyLoader />
)

Available Props/Defaults/Types

Standard Default Props For ALL Loaders

propdefault
pColor:str#555
loading:booltrue *req

Additional Available Props

Loader/Spinnerheight:intwidth:intsColor:strspaceBetween:intthickness:introws:intlineHeight:int
PulseLoader100100#f3f3f3
BounceyLoader202020
SpinLoader5050#f3f3f310
BoxLoader100100
JamminLoader10
ContentLoader200 *req4 *req20

PLEASE NOTE: For ContentLoader width refers to the parent container's width (in px cannot be %). It will work without a width however the animation will be off slightly. It is the only loader where width does not refer to the actual loader's width. A use case would be:

  // ContentLoader example
  <div style={{ width: '500px' }}>
    <ContentLoader 
      width={500}
      rows={8}
      lineHeight={28}
    />
  </div>
  // props example
  <PulseLoader 
    width={200}
    height={200}
    pColor='dodgerblue' // can use hex or named color
    sColor='#FF711E' // can use hex or named color
  />

Contributing

I'd love to get some feedback and contribution from the community. Feel free to file an issue, create a pull request, or leave some feedback as to how you think this project can be improved! More loaders/spinners to be added soon!