# modal-library

> my first library react

Latest version **1.0.2** (published 2021-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install modal-library
pnpm add modal-library
yarn add modal-library
bun add modal-library
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-04-29 |
| First published | 2021-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 17 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wafa SODA |
| Maintainers | sodawafa |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2021-04-29
- 1.0.1 — 2021-04-29
- 1.0.0 — 2021-04-29

## README

# modal-library

> my first library

[![NPM](https://img.shields.io/npm/v/modal-library.svg)](https://www.npmjs.com/package/modal-library) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save modal-library
```

## Usage

```jsx
import React, { Component } from 'react'

import Modal from 'modal-library'
import 'modal-library/dist/index.css'

class Example extends Component {
  render() {
    return
    <Modal modalFn={true}
           modalBtnOpen={true}
           modalBtnClose={true}
    >
      <p>Modal React Library 😄</p>
    </Modal>
  }
}
```
or
```jsx
import React from 'react'
import Modal from './index'
import 'modal-library/dist/index.css'

class Example2 extends React.Component {
  state = {
    modal: false
  }

  constructor(props) {
    super(props)
    this.openModal = this.openModal.bind(this)
  }

  openModal() {
    this.setState({ modal: true })
  }

  closeModal() {
    this.setState({ modal: false })
  }

  render() {
    return (
      <div>
        <button className='modal-btn' onClick={this.openModal}>
          open modal
        </button>
        <Modal
          modalFn={false}
          modalBtnOpen={false}
          modalBtnClose={true}
          modal={this.state.modal}
          openModal={this.openModal.bind(this)}
          closeModal={this.closeModal.bind(this)}
          top={'20%'}
          style={{margin:0}}
        >
          <p>component with modal</p>
        </Modal>
      </div>
    )
  }
}

export default Example2

```
## Etape creation library react

> [Readme](https://github.com/transitive-bullshit/create-react-library)

## License

MIT © [Wafa SODA](https://gitlab.com/sodawafa/modal-library-react)

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