# zz-modal

> React modal component

Latest version **1.0.4** (published 2023-10-30) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-10-30 |
| First published | 2023-10-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zhanna Zucher |
| Maintainers | zhannazucher |
| Keywords | react, modal, dialog |

## Links

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

## 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.0.4 (latest) — 2023-10-30
- 1.0.3 — 2023-10-23
- 1.0.2 — 2023-10-21
- 1.0.1 — 2023-10-18
- 1.0.0 — 2023-10-18

## README

# React zz-modal [![npm package](https://img.shields.io/npm/v/zz-modal.svg?style=flat-square)](https://www.npmjs.org/package/zz-modal)

React zz-modal is a easiest way to create and custom a dialog in your app.

- Very small (less than 10Kb)
- Mobile friendly
- Without dependencies
- Customizable 

## Installation

`npm i zz-modal`

## Usage

```jsx
import { Modal } from "zz-modal"
import { useState } from "react"

function App() {
  const [showModal, setShowModal] = useState(false)
  return (
    <div>
	 <button onClick={() => setShowModal(true)}>Show modal</button>
      <Modal active={showModal} setActive={setShowModal}>
        <p>Your content goes here !</p>
      </Modal>
    </div>
  )
}
```

* Add your styles to the Modal component by passing additional props `customClass`:

Example :
```jsx
<Modal active={showModal} setActive={setShowModal} customClass="myOwnClass">
        {children}
      </Modal>
```

## Props

The `Modal` component accepts the following props:

- `active` (boolean, required): Whether the modal is open or closed.
- `setActive` (function, required) : Triggers `active` props value.
- `children` (ReactNode) : Children passed to the modal body, your own content.
- `customClass` (string, optional) :  Custom CSS class name to be added to the modal for additional styling or customization in your usual way.

## Prerequisites

![npm](https://img.shields.io/badge/npm-9.2.0-%23000000?style=flat-square&logo=npm&logoColor=white)

![Node.js](https://img.shields.io/badge/Node.js-18.12.1-43853D?style=flat-square&logo=node.js&logoColor=white)

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