# react-prelodr

> A React component based on Prelodr

Latest version **1.1.4** (published 2017-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-prelodr
pnpm add react-prelodr
yarn add react-prelodr
bun add react-prelodr
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2017-06-20 |
| First published | 2017-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | José Luis Quintana |
| Maintainers | joseluisq |
| Keywords | react, prelodr, preloader, react-component |

## Links

- npm: https://www.npmjs.com/package/react-prelodr
- Repository: https://github.com/joseluisq/react-prelodr
- Homepage: https://github.com/joseluisq/react-prelodr#readme
- Issues: https://github.com/joseluisq/react-prelodr/issues
- npm.io page: https://npm.io/package/react-prelodr

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^15.6.1
- [prelodr](https://npm.io/package/prelodr.md) ^2.1.0
- [react-dom](https://npm.io/package/react-dom.md) ^15.6.1
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10

## 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

- 1.1.4 (latest) — 2017-06-20
- 1.1.3 — 2017-06-20
- 1.1.2 — 2017-06-20
- 1.1.1 — 2017-06-20
- 1.1.0 — 2017-01-31
- 1.0.1 — 2017-01-11
- 1.0.0 — 2017-01-04

## README

# react-prelodr [![Build Status](https://travis-ci.org/joseluisq/react-prelodr.svg?branch=master)](https://travis-ci.org/joseluisq/react-prelodr) [![Coverage Status](https://coveralls.io/repos/github/joseluisq/react-prelodr/badge.svg?branch=master)](https://coveralls.io/github/joseluisq/react-prelodr?branch=master) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
> A [React](https://github.com/facebook/react) component based on [Prelodr](https://github.com/joseluisq/prelodr).

## Install

[Yarn](https://github.com/yarnpkg/)

```sh
yarn add react-prelodr --dev
```

[NPM](https://www.npmjs.com/)

```sh
npm install react-prelodr --save-dev
```

## Usage

```js
import React from 'react'
import ReactDOM from 'react-dom'
import ReactPrelodr from 'react-prelodr'

class App extends React.Component {

  onClick () {
    // Get the wrapper component reference
    const pre = this.refs.myRef

    // You can also get the Prelodr instance for access to API (optional)
    const PrelodrInstance = pre.getPrelodr()

    // Play
    pre
      .show('Starting...')
      .hide()

      .show('Processing...')
      .hide()

      .show('Finishig...')
      .hide()
  }

  onShown () {
    console.log('When component is shown!')
  }

  onHidden () {
    console.log('When component is hidden!')
  }

  render () {
    return <div>
      <button onClick={this.onClick.bind(this)}>Show Prelodr</button>

      <ReactPrelodr ref='myRef'
        prefixClass='prelodr'
        duration={800}
        onShown={this.onShown}
        onHidden={this.onHidden}
      />
    </div>
  }

}

ReactDOM.render(
  <App />,
  document.getElementById('root')
)
```

Check out [Codepen Demo](http://codepen.io/joseluisq/pen/bgLery) for more details.

## CDN
The UMD and style files are also available on [unpkg](https://unpkg.com):

```html
<!-- Prelodr Style -->
<link href="https://unpkg.com/prelodr/dist/prelodr.min.css">
<!-- React-Prelodr Component -->
<script src="https://unpkg.com/react-prelodr/dist/react-prelodr.min.js"></script>
```

## License
MIT license

© 2017 [José Luis Quintana](http://git.io/joseluisq)

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