# @react-comps/message

> An awesome libary

Latest version **0.0.2** (published 2018-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @react-comps/message
pnpm add @react-comps/message
yarn add @react-comps/message
bun add @react-comps/message
```

## 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.2 |
| Published | 2018-11-08 |
| First published | 2018-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 418.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sunsunny |
| Maintainers | sunsunnydxx |

## Links

- npm: https://www.npmjs.com/package/@react-comps/message
- npm.io page: https://npm.io/package/@react-comps/message

## Recent versions

- 0.0.2 (latest) — 2018-11-08
- 0.0.1 — 2018-10-26

## README

# Introduction

message popup tool

# Install

npm

```shell
npm install @react-comps/message
```

yarn

```shell
yarn add @react-comps/message
```

# Usage

```jsx
import message from '@react-comps/message';
import '@react-comps/message/dist/message.css';

// ...
const config = {
  // position
  place: 'top', // top | center | bottom
  distance: '50px', // 50px | 30% (When `place = center` don't can ignore)

  /**
   * css Text
   */
  cssText: 'background: rbga(0, 0, 0); color: red', // inline style
};

hasbtn.onclick = function () {
  message.show('bad request！', 5000, config);
}

configbtn.onclick = function() {
  message.updateConfiguration(config);
}

nobtn.onclick = function () {
  message.show('bad request!');
}
```

# API

## show

```js
message.show(
  content: string | number = '',
  duration: number = 2000,
  configuration: object = {
    place: 'center',
    distance: '50%',
  }
  );
```

## updateConfiguration

update global configuration

```js
const config = {
  // position
  place: 'top', // top | center | bottom
  distance: '50px', // 50px | 30% (When `place = center` don't can ignore)

  /**
   * css Text
   */
  cssText: 'background: rbga(0, 0, 0); color: red', // inline style
};

message.updateConfiguration(config);
```

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