# @cig/modal

> React Modal Control

Latest version **0.0.5** (published 2021-10-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @cig/modal
pnpm add @cig/modal
yarn add @cig/modal
bun add @cig/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.0.5 |
| Published | 2021-10-11 |
| First published | 2021-10-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | z |
| Maintainers | loseyear, marken, ancf |
| Keywords | react, modal |

## Links

- npm: https://www.npmjs.com/package/@cig/modal
- Repository: https://github.com/cig-data/x
- Homepage: https://github.com/cig-data/x/tree/master/packages/modal#readme
- Issues: https://github.com/cig-data/x/issues
- npm.io page: https://npm.io/package/@cig/modal

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.13.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.13.1
- [styled-components](https://npm.io/package/styled-components.md) ^5.1.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

- 0.0.5 (latest) — 2021-10-11
- 0.0.4 — 2021-10-11
- 0.0.3 — 2021-10-11
- 0.0.2 — 2021-10-11

## README

# @cig/select
> The Modal control for React.

## Demo
[https://codesandbox.io/s/cig-modal-4f487](https://codesandbox.io/s/cig-modal-4f487)

## Installation and usage
> The easiest way to use @cig/modal is to install it from npm and build it into your app with Webpack.

```js
npm i -S @cig/modal
```

Then use it in your App:

```js
import React, {
  useState,
  useEffect,
} from 'react'
import Modal from '@cig/modal'

export default () => {
  const [show, setShow] = useState(false)

  useEffect(() => console.log(show), [show])

  return (
    <>
      <div
        onClick={() => setShow(true)}
        role="button"
        onKeyUp={() => {}}
        tabIndex={0}
      >
        <p>click show modal</p>
      </div>
      <Modal
        show={show}
        content="hello world"
        onChange={() => setShow(false)}
      />
    </>
  )
}
```

## Props

| 名称 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| show | Boolean | Y | false | 展示 |
| content | String | Y | - | 提示文字 |
| onChange | Function | Y | - | 确定按钮回调 |

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