Simple yet highly configurable activity indicator for React.
npm install react-activity-indicatorSimple yet highly configurable activity indicator for React.
Install with NPM: npm install react-activity-indicator
Import in (es6):
import ActivityIndicator from 'react-activity-indicator'
The CSS file:
``html`
E.g. import in default using webpack:
`html`
import 'react-activity-indicator/src/activityindicator.css'
The component accepts these props.
- number: the number of activity indicators default: 3diameter
- : size of the loading indicators default: 20pxduration
- : color transition duration default: 400(ms)color
- : color of the inactive loading indicator. default: transparentactiveColor
- : color of the active loading indicator. default: blackborderRadius
- : border radius of the loading indicators. default: 10%borderWidth
- : border width of the loading indicators. default: 1pxborderColor
- : border color of the loading indicators. default: black
`jsx`
diameter={40}
borderWidth={1}
duration={300}
activeColor="#66D9EF"
borderColor="white"
borderWidth={5}
borderRadius="50%"
/>
`jsx
class ExampleComponent extends Component {
constructor(props) {
super(props)
this.state = { loaded: false, counter:0 }
this.interval = setInterval(() => {
if (this.state.counter > 5000) {
this.setState({loaded: true})
clearInterval(this.interval)
}
this.setState({counter: this.state.counter+50})
},100)
}
render() {
if (!this.state.loaded) {
return ()
Loading {this.state.counter} / 5000 elements
} else {
return (
)
Loaded!
}
}
}
ReactDOM.render(
document.getElementById('app')
);
`
1. Fork it!
2. Create your feature branch: git checkout -b my-new-featuregit commit -am 'Add some feature'
3. Commit your changes: git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request :D
* Submitted to GitHub & NPM
Alex Dunmow
MIT license. Feel free to do whatever you want, but we have no liability or obligation for support.