# react-easypopin

> react easypopin

Latest version **1.0.3** (published 2016-09-30) · BSD license · 0 weekly downloads

## Install

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

## 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.0.3 |
| Published | 2016-09-30 |
| First published | 2016-09-28 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Maintainers | d31k34n |
| Keywords | react, reactjs, react-component |

## Links

- npm: https://www.npmjs.com/package/react-easypopin
- npm.io page: https://npm.io/package/react-easypopin

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^15.3.2
- [react-dom](https://npm.io/package/react-dom.md) 15.3.2
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [babel-runtime](https://npm.io/package/babel-runtime.md) ~5.8.20

## 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.0.3 (latest) — 2016-09-30
- 1.0.2 — 2016-09-30
- 1.0.1 — 2016-09-30
- 1.0.0 — 2016-09-28

## README

# react easypopin

Get the AMD module located at `react-easypopin.js` and include it in your project.

## **Installation**

```
 npm install --save-dev react-easypopin
```

## **Usage**

* Import the plugin
* Instantiate it in the template
* Define its properties

```js
// importation
import ReactEasypopin from 'react-easypopin';

// usage in template
<ReactEasypopin {...props}>
    // CONTENT
</ReactEasypopin>
```

### Defining Properties :  

| Property   | Usage           | default  |
|----------|:-------------:|:-------:|
| **ref** |  the reference of the popin in your template |          |
| **opened** |    if true, the popin is automatically opened   | false |       
| **closable** | enables to close the popin | true |
| **overlay** | displays an overlay around the popin | true |
| **closableWithOverlayClick** | enables click on the overlay to close the popin | true |
| **withCloseButton** | displays a close icon at the top right | true |
| **animation** | defines the CSS class to run appear & disappear animation. (cf. animation) | *EFFECT_APPEAR_DEFAULT* |

## Animation

The popin can be opened and closed with classy CSS3 animations. Those are available using following constants :

* *EFFECT_APPEAR_FROM_LEFT_TO_RIGHT*
* *EFFECT_APPEAR_FROM_RIGHT_TO_LEFT*
* *EFFECT_APPEAR_FROM_TOP_TO_BOTTOM*
* *EFFECT_APPEAR_FROM_BOTTOM_TO_TOP*
* *EFFECT_APPEAR_BY_HORIZONTAL_3D*
* *EFFECT_APPEAR_DEFAULT*

You can also define your own CSS class string and animation instead of using pre-configured constants.

Example of usage :

```js

import React, { Component } from 'react';
import ReactEasypopin, { EFFECT_APPEAR_FROM_BOTTOM_TO_TOP } from 'react-easypopin';

export default class Example extends Component {
    render () {
        <div className="Example">
            <ReactEasypopin
                animation={EFFECT_APPEAR_FROM_BOTTOM_TO_TOP}
                ref="popin"
            />
        </div>
    }
}

```

## trigger open & close

You can trigger an action to open the popin by calling following methods using REFS :

* open()
* close()

Here is a sample integration (ES6) :

```js

import React, { Component } from 'react';
import ReactEasypopin from 'react-easypopin';

export default class widget extends Component {
    openPopin () {
        this.refs.popin.open();
    }
    render = () => (
        <div id="widget-container">
            <button onClick={this.openPopin}>Open</button>
            <ReactEasypopin ref='popin'>
                <div id="content">
                    <p>this is the content of my popin :)</p>
                </div>
            </ReactEasypopin>
        </div>
    );
}

```

## Contribution on the code ?

* Fork the project and create a new branch
* Run the server : `npm start`.
* Continuously run tests on file changes `npm run watch-test`;
* Run tests: `npm test`;
* Build `npm run build`;

**Please note that tests are automatically run on pre-push. Push isn't possible if tests are wrong !!**

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