0.3.8 • Published 7 years ago

react-spinners_new v0.3.8

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

React Spinners

npm version circle ci downloads license Code Triagers Badge

dependencies Status devDependencies Status peerDependencies Status

This is just a fork of https://www.npmjs.com/package/react-spinners, made small changes to have Packman loader eat anything(that's it everything else is the same)

A collection of loading spinners with React.js based on Halogen.

This package is bootstraped using react-npm-boilerplate

Demo

Demo Page

Installation

npm install react-spinners --save

Usage

Each loader has their own default properties. You can overwrite the defaults by passing props into the loaders.

Each loader accepts a loading prop as a boolean. The loader will not render anything if loading is false. The loading prop defaults to true.

IMPORTANT: This package uses emotion. Remember to add the plugin to .babelrc, for example:

{
    "presets": ["react", "es2015", "stage-0"],
    "plugins": ["emotion"]
}

Example

import React from 'react';
import { RingLoader } from 'react-spinners';

class AwesomeComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      loading: true
    }
  }
  render() {
    return (
      <div className='sweet-loading'>
        <RingLoader
          color={'#123abc'} 
          loading={this.state.loading} 
        />
      </div>
    )
  }
}

Available Loaders, PropTypes, and Default Values

Common default props for all loaders:

loading: true
color: '#000000'
Loadersize:intheight:intwidth:intradius:intmargin:str
BarLoader4100
BeatLoader152px
BounceLoader60
CircleLoader50
ClipLoader35
ClimbingBoxLoader15
DotLoader602px
FadeLoader15522px
GridLoader15
HashLoader502px
MoonLoader602px
PacmanLoader252px
PropagateLoader15
PulseLoader152px
RingLoader602px
RiseLoader152px
RotateLoader152px
ScaleLoader35422px
SyncLoader152px