# overlays

> React library for rendering overlays.

Latest version **2.2.1** (published 2022-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install overlays
pnpm add overlays
yarn add overlays
bun add overlays
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2022-05-05 |
| First published | 2019-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=7.6.0 |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Morris Allison III |
| Maintainers | morrisallison |
| Keywords | react |

## Links

- npm: https://www.npmjs.com/package/overlays
- Repository: https://github.com/morrisallison/overlays
- Homepage: https://github.com/morrisallison/overlays#readme
- Issues: https://github.com/morrisallison/overlays/issues
- npm.io page: https://npm.io/package/overlays

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

- 2.2.1 (latest) — 2022-05-05
- 2.2.0 — 2022-04-20
- 2.1.1 — 2022-04-19
- 2.1.0 — 2022-04-19
- 2.0.1 — 2020-07-29
- 2.0.0 — 2020-07-01
- 1.0.1 — 2020-06-25
- 1.0.0 — 2020-06-25
- 1.0.0-beta — 2020-04-27
- 1.0.0-alpha.3 — 2019-05-15
- 1.0.0-alpha.2 — 2019-05-14
- 1.0.0-alpha.1 — 2019-05-14
- 1.0.0-alpha — 2019-05-14

## README

# Overlays

> React library for rendering overlays.

[![npm Version][badge-npm]][npm]
[![MIT License][badge-license]][license]

[badge-license]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
[badge-npm]: https://img.shields.io/npm/v/overlays.svg?style=flat-square
[license]: https://github.com/morrisallison/overlays/raw/main/LICENSE
[npm]: https://www.npmjs.com/package/overlays

## Overview

Overlays is a simple library that facilitates the creation of overlays in React without using portals.

#### Features

* Simple, easy to use API
* Doesn't require React portals
* CSS agnostic

## Usage

```tsx
import { Overlay, OverlayProvider, OverlayRoot } from "overlays";

function MyHomePage() {
  return (
    <OverlayProvider>
      <main>
        <h1>Hello World!</h1>
        <section>
          <p>Page content</p>
          <Overlay>
            <p key="myOverlay">Overlay content</p>
          </Overlay>
        </section>
        <OverlayRoot />
      </main>
    </OverlayProvider>
  );
}

function MyAboutPage() {
  return (
    <OverlayProvider>
      <main>
        <h1>About Us!</h1>
        <section>
          <p>Page content</p>
          <Overlay scope="modal">
            <p>Modal content</p>
          </Overlay>
          <Overlay scope="alert">
            <p key="first">First alert</p>
          </Overlay>
          <Overlay scope="alert">
            <p key="second">Second alert</p>
          </Overlay>
        </section>
        <OverlayRoot scope="modal" />
        <OverlayRoot scope="alert"  />
      </main>
    </OverlayProvider>
  );
}
```

## Installation

Node.js via [npm](https://www.npmjs.com/)

```bash
npm i overlays
```

Node.js via [Yarn](https://yarnpkg.com/)

```bash
yarn add overlays
```

## License

Copyright &copy; 2020 [Morris Allison III](http://morris.xyz).
<br>Released under the [MIT license][license].

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