# react-modal-customizable

> This module allows to integrate a modals simply and customize in your react app.

Latest version **1.2.2** (published 2020-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-modal-customizable
pnpm add react-modal-customizable
yarn add react-modal-customizable
bun add react-modal-customizable
```

## 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.2.2 |
| Published | 2020-02-24 |
| First published | 2020-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 232.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Axel Lavoie |
| Maintainers | achak |
| Keywords | react, modal, custom, react-component |

## Links

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

## Dependencies (2)

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

## 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.2.2 (latest) — 2020-02-24
- 1.2.1 — 2020-02-24
- 1.2.0 — 2020-02-24
- 1.1.8 — 2020-02-24
- 1.1.7 — 2020-02-14
- 1.1.6 — 2020-02-14
- 1.1.5 — 2020-02-10
- 1.1.4 — 2020-02-09
- 1.1.3 — 2020-02-09
- 1.1.2 — 2020-02-09
- 1.1.1 — 2020-02-09
- 1.1.0 — 2020-02-09
- 1.0.1 — 2020-02-09
- 1.0.0 — 2020-02-09

## README

# react-modal-customizable <!-- omit in toc -->
This module allows to integrate a modals simply and customize in your react app.

## Table of Contents <!-- omit in toc -->

- [Installation](#installation)
- [Examples](#examples)
- [Props](#props)
  - [General](#general)
  - [Buttons](#buttons)
  - [Style](#style)
  - [Callbacks](#callbacks)
- [Functions](#functions)
  - [showModal()](#showmodal)
  - [hideModal()](#hidemodal)
  - [License](#license)

## Installation
To install, you can use npm or yarn:
```
$ npm install react-modal-customizable
$ yarn add react-modal-customizable
```

## Examples
``` js
import React from 'react';
import Modal from 'react-modal-customizable'

class Exemple extends React.Component {
    render() {
        return (
            <div className="development-screen screen">
                <Modal
                    ref={(modal) => this.modal = modal}
                    styleOverlay={{
                        backgroundColor: "black"
                    }}
                    styleContent={{
                        backgroudColor: "green"
                    }}
                    closeButton={true}
                    title="Your title"
                >
                    <div>Your content</div>
                </Modal>

                <button
                    onClick={ () => this.modal.showModal() }
                >
                    Show the modal
                </button>
            </div>
        )
    };
}

export default Example;
```

## Props
### General
|      Props       | Description                                |  Type   | Default |
| :--------------: | :----------------------------------------- | :-----: | :-----: |
|      title       | Use to set a title in the modal            | String  |  null   |
|   closeButton    | Use to show or hide the close button       | Boolean |  true   |
| hideClickOutside | Use to hide the modal if you click outside | Boolean |  false  |

### Buttons
|  Props  | Description                 | Type  | Default |
| :-----: | :-------------------------- | :---: | :-----: |
| buttons | Use to set multiple button. | Array |   []    |

#### Exemple : <!-- omit in toc -->
``` js
<Modal
    buttons={
        [
            ...
            {
                value: "Delete",
                onClick: yourFunction,
                style: {
                    fontSize: "2rem"
                },
                type: "primary" 
            }
            ...
        ]
    }
/>
```
#### Parameters of the buttons <!-- omit in toc -->
|  Props  | Description                                                                                                         |   Type   |  Default  |
| :-----: | :------------------------------------------------------------------------------------------------------------------ | :------: | :-------: |
|  value  | Text in the button.                                                                                                 |  String  |   null    |
| onClick | Action of the click.                                                                                                | Function |   null    |
|  style  | Style of the button.                                                                                                |  Object  |    {}     |
|  type   | Type of the button. <br/> ("primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "link") |  String  | "default" |


### Style
|      Props       | Description                                 |  Type  | Default |
| :--------------: | :------------------------------------------ | :----: | :-----: |
|  styleContainer  | Use to change the style of the container    | Object |   {}    |
|   styleOverlay   | Use to change the style of the overlay      | Object |   {}    |
|   styleContent   | Use to change the style of the content      | Object |   {}    |
|    styleTitle    | Use to change the style of the title        | Object |   {}    |
| styleCloseButton | Use to change the style of the close button | Object |   {}    |


### Callbacks
| Props  | Description                          |   Type   | Default |
| :----: | :----------------------------------- | :------: | :-----: |
| onShow | Callback fired after show the modal. | Function |  null   |
| onHide | Callback fired hide show the modal.  | Function |  null   |

## Functions
### showModal()
Use to show the modal.
``` js
this.modal.showModal()
```

### hideModal()
``` js
this.modal.hideModal()
```

### License
MIT

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