# popchat

> A react module to manage your chatheads onscreen, on any page. 1. Load the component on any parent component. It takes in 4 props, they are 1. `chatHead`: Takes in a string to as the name of the tab 2. `messages`: Takes an array of messages to disp

Latest version **0.1.4** (published 2020-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install popchat
pnpm add popchat
yarn add popchat
bun add popchat
```

## 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.1.4 |
| Published | 2020-09-12 |
| First published | 2020-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hussain Safwan |
| Maintainers | hussain_safwan |
| Keywords | popchat, chat, chatheads, messages, popup |

## Links

- npm: https://www.npmjs.com/package/popchat
- npm.io page: https://npm.io/package/popchat

## Dependencies (1)

- [react-icons](https://npm.io/package/react-icons.md) ^3.11.0

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads
- [react-native-modal-translucent-axton](https://npm.io/package/react-native-modal-translucent-axton.md) — 4 weekly downloads

## Recent versions

- 0.1.4 (latest) — 2020-09-12
- 0.1.3 — 2020-09-12
- 0.1.2 — 2020-09-12
- 0.1.1 — 2020-09-12
- 0.1.0 — 2020-09-11

## README

## Guide
A react module to manage your chatheads onscreen, on any page. 
1. Load the component on any parent component. It takes in 4 props, they are
   1. `chatHead`: Takes in a string to as the name of the tab
   2. `messages`: Takes an array of messages to display. The array contains object of following structure, 
        ``` js
            const messages = [
                {
                    sender: 'me',   //displayed in pale background
                    text: 'hey there!' 
                },
                {
                    sender: 'others',//displayed in background color specified in themeColor prop
                    text: 'what's up
                }
            ]
        ```
    3. `getMessage`: A function to retriev the message in the bubbel input, fired on pressing the `Enter`. Here's to define,
    ``` js
        const getMessage = (msg) => { 
            //process msg, the message in string 
            console.log(msg)
        } 
    ```
    4. `themeColor`: Optional prop t ospecify the theme color of the component, violet by default. 
    
Here's a complete picture,
``` js
      const msgs = [
    {
      sender: 'me',
      text: 'hey, whatsup!'
    },
    {
      sender: 'others',
      text: 'hey, whatsup!'
    }, 
    {
      sender: 'others',
      text: 'hey, whatsup!'
    },
    {
      sender: 'me',
      text: 'hey, whatsup!'
    },
  ]
  const getMessage = (msg) => {
    console.log('App', msg)
  }
  
  return (
    <div>
        <Popchat messages={msgs} getMessage={getMessage} themeColor={'lightseagreen'} chatHead={'John Doe'} />
    </div>
  )
```

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