# backstage-modal

> backstage modal

Latest version **0.3.2** (published 2017-08-15) · MIT license · 0 weekly downloads

## Install

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

## 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.3.2 |
| Published | 2017-08-15 |
| First published | 2016-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | andrewsmedina, mdionisio, metal, raphamorim, rfloriano, ricobl, siminino, vierno |

## Links

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

## Dependencies (2)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [react-portal-stateless](https://npm.io/package/react-portal-stateless.md) ^1.0.3

## Recent versions

- 0.3.2 (latest) — 2017-08-15
- 0.3.1 — 2017-08-01
- 0.3.0 — 2017-08-01
- 0.2.6 — 2017-04-04
- 0.2.5 — 2017-02-17
- 0.2.4 — 2017-02-15
- 0.2.3 — 2017-02-06
- 0.2.2 — 2017-02-03
- 0.2.1 — 2017-02-03
- 0.2.0 — 2017-01-30
- 0.1.0 — 2016-08-24

## README

# backstage-modal

[![Build Status](https://travis-ci.org/backstage-ui/backstage-modal.png?branch=master)](https://travis-ci.org/backstage-ui/backstage-modal)

Backstage Modal React component

## Installing

```bash
npm install backstage-modal --save
```

## Components

### `<Modal />`

Main component that includes the overlay, the modal window and its contents.

Use `children` to render the inner content of the modal window.

#### Props

* `isOpen`: flag indicating wether the modal is opened or not (default `false`);
* `title`: title of the modal window;
* `width`: CSS width of the modal window (default `500px`);
* `onCloseRequest`: callback called when the user attempts to close the modal:
  * by clicking on the close button;
  * by clicking on the overlay;
  * by pressing the ESC key.

### `<ModalBody />`

Optional child component to wrap content and get some nice default styles.

### `<ModalFooter />`

Optional child component to wrap content and get some nice default styles along
with a separator.


## Example

```js
import React, {Component} from 'react';
import ReactDOM from "react-dom";
import Modal, {ModalBody, ModalFooter} from 'backstage-modal';

class Example extends Component {
  constructor(){
    this.state = {
      isOpen: true
    };
  }

  onCloseRequest(){
    this.setState({isOpen: false});
  }

  render(){
    return (
      <Modal isOpen={this.state.isOpen} title="Backstage Modal" onCloseRequest={() => this.onCloseRequest}>
        <ModalBody>
          <p>Body</p>
        </ModalBody>
        <ModalFooter>
          <button type="button">OK</button>
        </ModalFooter>
      </Modal>
    );
  }
}

ReactDOM.render(<Example />, document.getElementById('container'));
```

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