# react-activity-indicator

> Simple yet highly configurable activity indicator for React.

Latest version **0.7.77** (published 2017-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-activity-indicator
pnpm add react-activity-indicator
yarn add react-activity-indicator
bun add react-activity-indicator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.77 |
| Published | 2017-06-09 |
| First published | 2016-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Alex Dunmow |
| Maintainers | blockninja |
| Keywords | react, activity, indicator, loader |

## Links

- npm: https://www.npmjs.com/package/react-activity-indicator
- Repository: https://github.com/BlockNinja/react-activity-indicator
- Issues: https://github.com/BlockNinja/react-activity-indicator/issues
- npm.io page: https://npm.io/package/react-activity-indicator

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^15.5.4
- [react-dom](https://npm.io/package/react-dom.md) ^15.5.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.7.77 (latest) — 2017-06-09
- 0.7.71 — 2017-04-12
- 0.7.7 — 2016-09-04
- 0.7.620 — 2016-07-19
- 0.7.62 — 2016-07-18
- 0.7.61 — 2016-07-18
- 0.7.6 — 2016-07-18
- 0.7.5 — 2016-07-17
- 0.7.4 — 2016-07-17
- 0.7.3 — 2016-07-17
- 0.7.2 — 2016-07-17
- 0.7.1 — 2016-07-17
- 0.0.1 — 2016-07-17

## README

# React Activity Indicator

Simple yet highly configurable activity indicator for React.

![See me work](http://i.imgur.com/gtERQ2h.gif)

## [Demo](https://blockninja.github.io/react-activity-indicator/)

## Installation

Install with NPM: `npm install react-activity-indicator`

Import in (es6):

`import ActivityIndicator from 'react-activity-indicator'`

The CSS file:

```html
<link rel="stylesheet" type="text/css" href="path/to/activityindicator.css">
```

E.g. import in default using webpack:
```html
import 'react-activity-indicator/src/activityindicator.css'
```

## Usage

The component accepts these props.

- `number`: the number of activity indicators `default: 3`
- `diameter`: size of the loading indicators `default: 20px`
- `duration`: color transition duration `default: 400`(ms)
- `color`: color of the inactive loading indicator. `default: transparent`
- `activeColor`: color of the active loading indicator. `default: black`
- `borderRadius`: border radius of the loading indicators. `default: 10%`
- `borderWidth`: border width of the loading indicators. `default: 1px`
- `borderColor`: border color of the loading indicators. `default: black`


```jsx
<ActivityIndicator
	number={5}
	diameter={40}
	borderWidth={1}
	duration={300}
	activeColor="#66D9EF"
	borderColor="white"
	borderWidth={5}
	borderRadius="50%" 
/>
```

## Example

```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 (<div style={{textAlign: 'center'}}>
    		Loading {this.state.counter} / 5000 elements
				<ActivityIndicator number={10} duration={200} activeColor="#0070bf" borderWidth={2} borderRadius="50%" diameter={25} />
			</div>)
  	} else {
  		return (
  			<div style={{textAlign: 'center'}}>
	  			<h3>Loaded!</h3>
  			</div>)
  	}
  }
}

ReactDOM.render(
	<ExampleComponent />,
  document.getElementById('app')
);

```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## History

* Submitted to GitHub & NPM

## Credits

Alex Dunmow

## License

MIT license. Feel free to do whatever you want, but we have no liability or obligation for support.

---
_Source: https://npm.io/package/react-activity-indicator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
