better-react-spinkit
Version:
A collection of loading indicators animated with CSS for React
85 lines (67 loc) ⢠2.11 kB
Markdown
//img.shields.io/npm/v/better-react-spinkit.svg?style=flat-square
[ ]: https://img.shields.io/npm/dt/better-react-spinkit.svg?maxAge=2592000
[ ]: https://www.npmjs.com/package/better-react-spinkit
[ ]: https://img.shields.io/travis/bentatum/better-react-spinkit.svg?style=flat-square
[ ]: https://travis-ci.org/bentatum/better-react-spinkit
[ ]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[ ]: http://npm.im/standard
A collection of loading indicators animated with CSS, powered by React.
Donate BTC: `1H7dDZeisBvvnJZtXJ7f5TCqNv2W3MnRN2`
Donate ETH: `0x660ABF8bc22FDCebe26bb570f02D47C2b9828432`
Donate LTC: `LQJsuBUg1kPrxJT7KWjcAFVQaDsY7h1f6B`
`npm i better-react-spinkit`
```js
import {
ChasingDots,
Circle,
CubeGrid,
DoubleBounce,
FadingCircle,
FoldingCube,
Pulse,
RotatingPlane,
ThreeBounce,
WanderingCubes,
Wave
} from 'better-react-spinkit'
// somewhere in a render function ...
<Circle />
```
Optionally, you can configure size and color props in context to avoid managing configuration on each instance.
```js
import { default as React, Component, PropTypes } from 'react'
import { ThreeBounce } from 'better-react-spinkit'
class Application extends Component {
static childContextTypes = {
betterReactSpinkit: PropTypes.object
};
getChildContext () {
return {
betterReactSpinkit: {
color: 'green',
size: 25
}
}
}
render () {
// Inline props override the contextual settings.
return (
<ThreeBounce size={15} color='blue' />
)
}
}
```
Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.
[ ](LICENSE.md)
š [docs](http://better-react-spinkit.benjamintatum.com/)
[![npm][npm-image]][npm-url]
[![npm][npm-downloads-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]
[ ]: https: