# react-tailwind-modal

> A simple modal with React and Tailwind

Latest version **1.5.0** (published 2022-09-21) · ISC license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2022-09-21 |
| First published | 2022-08-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matthieu Chollet |
| Maintainers | mcholl85 |
| Keywords | React, Tailwind, Modal |

## Links

- npm: https://www.npmjs.com/package/react-tailwind-modal
- Repository: https://github.com/mcholl85/react-tailwind-modal
- Homepage: https://github.com/mcholl85/react-tailwind-modal#readme
- Issues: https://github.com/mcholl85/react-tailwind-modal/issues
- npm.io page: https://npm.io/package/react-tailwind-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.5.0 (latest) — 2022-09-21
- 1.4.0 — 2022-09-07
- 1.3.0 — 2022-09-07
- 0.9.0 — 2022-09-01
- 0.8.0 — 2022-08-31
- 0.7.0 — 2022-08-31
- 0.6.0 — 2022-08-31
- 0.5.0 — 2022-08-31
- 0.4.0 — 2022-08-31
- 0.3.0 — 2022-08-31
- 0.2.0 — 2022-08-31
- 0.1.0 — 2022-08-31

## README

# react-tailwind-modal

[![NPM version][npm-image]][npm-url]
[![Build][github-build]][github-build-url]
![npm-typescript]

## Installation:

```bash
npm install react-tailwind-modal --save-dev
```

or

```bash
yarn add -D react-tailwind-modal
```

## Usage :

Add `Modal` to your component:

```js
import React, { useState } from 'react'
import ReactDOM from 'react-dom/client'
import { Modal } from 'react-tailwind-modal'
import './index.css'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)

const App = () => {
  const [modal, setModal] = useState(false)
  return (
    <div>
      <h1 className='my-8 text-center text-3xl'>Modal</h1>
      <button
        onClick={() => setModal(true)}
        data-modal-toggle='modal'
        title='Close'
        className='mx-auto block text-sm bg-gray-900 text-white font-semibold py-2 px-4 border border-gray-900 rounded-md duration-200 ease-out hover:scale-105'
      >
        Open
      </button>
      <div>{modal && <Modal title='Welcome' content='Hello World' onClick={() => setModal(false)} />}</div>
    </div>
  )
}

root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
)
```

[npm-url]: https://www.npmjs.com/package/react-tailwind-modal
[npm-image]: https://img.shields.io/npm/v/react-tailwind-modal
[github-build]: https://github.com/mcholl85/react-tailwind-modal/actions/workflows/publish.yml/badge.svg
[github-build-url]: https://github.com/mcholl85/react-tailwind-modal/actions/workflows/publish.yml
[npm-typescript]: https://img.shields.io/npm/types/react-tailwind-modal

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