# react-a11y-modal

> An accessible & customizable modal dialog for React built with Hooks under the hood.

Latest version **1.1.4** (published 2020-11-26) · MIT license · 0 weekly downloads

## Install

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

## 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.1.4 |
| Published | 2020-11-26 |
| First published | 2019-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 7 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | pixelmanya |
| Maintainers | pixelmanya |
| Keywords | react, modal, dialog, a11y, accessibility, hooks |

## Links

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

## Dependencies (7)

- [eslint](https://npm.io/package/eslint.md) 5.12.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.13
- [classnames](https://npm.io/package/classnames.md) 2.2.6
- [@emotion/core](https://npm.io/package/@emotion/core.md) 10.0.7
- [focus-trap-react](https://npm.io/package/focus-trap-react.md) 6.0.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^4.1.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^3.0.1

## 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.1.4 (latest) — 2020-11-26
- 1.1.3 — 2020-11-26
- 1.1.2 — 2019-04-08
- 1.1.1 — 2019-04-05
- 1.1.0 — 2019-03-31
- 1.0.0 — 2019-03-29

## README

# react-a11y-modal

[![Build Status](https://travis-ci.com/pixelmanya/react-a11y-modal.svg?branch=master)](https://travis-ci.com/pixelmanya/react-a11y-modal) [![NPM](https://img.shields.io/npm/v/react-a11y-modal.svg)](https://www.npmjs.com/package/react-a11y-modal) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

An accessible & customizable modal dialog for [React](https://reactjs.org) built with [Hooks](https://reactjs.org/docs/hooks-intro.html) under the hood. It provides developers a decent-looking modal which they can use right away without worrying much about styling. However, if you need custom styles it's of course possible.

## Contents 📖

- [Installation](#installation-)
- [Usage](#usage-)
- [Docs](#docs-)
- [Demos](#demos-)
- [Accessibility](#accessibility-)
- [License](#license-)

## Installation ⚒

Use either [npm](https://npmjs.org/) or [yarn](https://yarnpkg.com):

```bash
npm install --save react-a11y-modal
yarn add react-a11y-modal

```

## Usage 🤔

There are plenty of [props](https://pixelmanya.github.io/react-a11y-modal/#props) available, which you can pass to `<Modal.Container />`.

### Basic modal

```jsx
import { Modal } from 'react-a11y-modal';

<Modal.Container>
  <h1>Title</h1>
  <button>Close</button>
</Modal.Container>;
```

### Header, Body and Footer

```jsx
import { Modal } from 'react-a11y-modal';

<Modal.Container>
  <Modal.Header>
    <h1>Title</h1>
    <button>Close</button>
  </Modal.Header>
  <Modal.Body>
    <p>Body</p>
  </Modal.Body>
  <Modal.Footer>
    <button>Footer button</button>
  </Modal.Footer>
</Modal.Container>;
```

## Docs 🤓

For detailed documentation there is this [page](https://pixelmanya.github.io/react-a11y-modal) with everything you need to know.

## Demos 💡

- [Basic Modal](https://pixelmanya.github.io/react-a11y-modal/#basic-modal)
- [Modal with Header, Body and Footer](https://pixelmanya.github.io/react-a11y-modal/#with-header-body-and-footer)
- [Unstyled Modal](https://pixelmanya.github.io/react-a11y-modal/#unstyled-modal)
- [Nested Modal](https://pixelmanya.github.io/react-a11y-modal/#nested-modal)
- [Confirmation Modal](https://pixelmanya.github.io/react-a11y-modal/#confirmation-modal) (custom)
- [Sign-in Modal](https://pixelmanya.github.io/react-a11y-modal/#sign-in-modal) (custom)

## Accessibility ♿️

react-a11y-modal was designed to follow the [W3C Specification](https://www.w3.org/TR/wai-aria-practices/#dialog_modal).

## License 🔓

MIT © [pixelmanya](https://github.com/pixelmanya)

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