# React Spinners [][npm_url] [][ci_url] [][npm_url] [][npm_url] [](https://coveralls.io/github/davidhu2000/react-spinners?branch=master) [](https://david-dm.org/davidhu2000/react-spinners) [](https://david-dm.org/davidhu2000/react-spinners?type=dev) [](https://david-dm.org/davidhu2000/react-spinners?type=peer) [npm_url]: https://www.npmjs.org/package/react-spinners [ci_url]: https://circleci.com/gh/davidhu2000/react-spinners A collection of loading spinners with React.js based on [Halogen](https://github.com/yuanyan/halogen). This package is bootstraped using [react-npm-boilerplate](https://github.com/juliancwirko/react-npm-boilerplate) ## Demo [Demo Page](https://www.react-spinners.com) ## Installation ```bash 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](https://github.com/emotion-js/emotion). Remember to add the plugin to `.babelrc`, for example: ``` { "presets": ["@babel/preset-react", "@babel/preset-env"], "plugins": ["emotion"] } ``` ### Examples ```js import React from 'react'; import { css } from '@emotion/core'; // First way to import import { ClipLoader } from 'react-spinners'; // Another way to import. This is recommended to reduce bundle size import ClipLoader from 'react-spinners/ClipLoader'; // Can be a string as well. Need to ensure each key-value pair ends with ; const override = css` display: block; margin: 0 auto; border-color: red; `; class AwesomeComponent extends React.Component { constructor(props) { super(props); this.state = { loading: true } } render() { return (