# react-dialogue-component

> A dialogue component for React apps

Latest version **0.2.4** (published 2022-03-14) · 0 weekly downloads

## Install

```sh
npm install react-dialogue-component
pnpm add react-dialogue-component
yarn add react-dialogue-component
bun add react-dialogue-component
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2022-03-14 |
| First published | 2022-03-11 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 454.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Humberto Bandeira |
| Maintainers | umberbn |
| Keywords | react, dialogue, styled-components |

## Links

- npm: https://www.npmjs.com/package/react-dialogue-component
- Repository: https://github.com/UmberBn/react-dialogue-component
- Homepage: https://github.com/UmberBn/react-dialogue-component#readme
- Issues: https://github.com/UmberBn/react-dialogue-component/issues
- npm.io page: https://npm.io/package/react-dialogue-component

## 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.2.4 (latest) — 2022-03-14
- 0.2.3 — 2022-03-14
- 0.2.1 — 2022-03-14
- 0.2.0 — 2022-03-14
- 0.1.17 — 2022-03-13
- 0.1.16 — 2022-03-13
- 0.1.15 — 2022-03-13
- 0.1.14 — 2022-03-12
- 0.1.13 — 2022-03-12
- 0.1.12 — 2022-03-12
- 0.1.11 — 2022-03-12
- 0.1.10 — 2022-03-12
- 0.1.9 — 2022-03-12
- 0.1.8 — 2022-03-12
- 0.1.7 — 2022-03-12
- … 5 more at https://npm.io/package/react-dialogue-component/versions

## README

# react-dialogue-component
[![npm version](https://badge.fury.io/js/react-dialogue-component.svg)](https://badge.fury.io/js/react-dialogue-component) 
![coverage](https://img.shields.io/badge/coverage-100%25-success)
![tests](https://img.shields.io/badge/tests-passing-success)

A simple React component made with styled-components

![Example gif](./ex-react-dialogue.gif)

## Table of Contents

* [Getting started](#getting-started)
* [Props](#Props)

## Getting started

### Installing
To install, you can use [npm](https://npmjs.org/) or [yarn](https://yarnpkg.com):


    $ npm install --save react-dialogue-component
    $ yarn add react-dialogue-component

### Example
```jsx
  import { useState } from "react";
  import { Dialogue } from "react-dialogue-component";
  
  export default function App() {
  const [dialogue, setDialogue] = useState(false);
  return (
    <div>
      <button
      onClick={() => setDialogue(!dialogue)}
      >
        active dialogue
      </button>
      <Dialogue
        isOpen={dialogue}
        onClose={() => setDialogue(false)}
        closeOnOverlayClick
        title="React Dialogue Demo"
        children="Dialogue example"
      />
    </div>
  );
}
```
[Demo of this example](https://codesandbox.io/s/react-dialogue-demo-jz20gd)

## Docs

### Props

| Name | Type | Default | Description | Required
|:-----|:-----|:-----|:-----|:-----|
| title | string | | The title of the dialogue | :x:
| children | ReactNode, string | | The description text for the component to render | :x:
| isOpen | boolean | false | Define if dialogue appear on screen | :heavy_check_mark:
| onClose | function | () => void | Triggerd when the user performs some modal closing action<br> the default actions are called when user press Esc button or click in close button "X" | :heavy_check_mark:
| closeOnOverlayClick | boolean | false | If is true onClose is called when user click on dialogue overlay |  :heavy_check_mark:


### Run Local

1. Clone this repository.

 ```bash
  git clone git@github.com:UmberBn/react-dialogue-component.git
 ```

2. Go to project folder.

 ```bash
 cd react-dialogue-component
```
3. Install the dependencies using yarn or npm

 ```bash
 yarn
 or
 npm install
```

 ### Scripts

  For execute a script you need to clone this repository and install the project dependencies [See Local section](#local)
  
  - Run all tests

  ```bash
    "npm|yarn" test
  ```
  - Generate the coverage of tests

  ```bash
    "npm|yarn" run test:coverage
  ```

  - Open the coverage file (run after test:coverage)

   You need google chrome.

  ```bash
    "npm|yarn" run open:coverage
  ```

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