# react-flash-message

> Simple component that unmounts a component after a given delay.

Latest version **1.0.8** (published 2021-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-flash-message
pnpm add react-flash-message
yarn add react-flash-message
bun add react-flash-message
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-11-17 |
| First published | 2018-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Daniel Sneijers |
| Maintainers | danielsneijers |

## Links

- npm: https://www.npmjs.com/package/react-flash-message
- Repository: https://github.com/danielsneijers/react-flash-message
- Homepage: https://github.com/danielsneijers/react-flash-message#readme
- Issues: https://github.com/danielsneijers/react-flash-message/issues
- npm.io page: https://npm.io/package/react-flash-message

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2

## Recent versions

- 1.0.8 (latest) — 2021-11-17
- 1.0.7 — 2021-06-01
- 1.0.6 — 2021-05-12
- 1.0.5 — 2020-11-20
- 1.0.4 — 2020-09-23
- 1.0.3 — 2020-08-14
- 1.0.2 — 2018-03-01
- 1.0.1 — 2018-03-01
- 1.0.0 — 2018-03-01

## README

# React Flash Message ✨

Simple component that unmounts a component after a given delay. It adds no styling or animations, you can use other components like [react-transition-group](https://github.com/reactjs/react-transition-group) for that.

## Basic Example

```jsx
import React from 'react';
import { render } from 'react-dom';
import FlashMessage from 'react-flash-message'

const Message = () => (
  <FlashMessage duration={5000}>
    <strong>I will disapper in 5 seconds!</strong>
  </FlashMessage>
)

render(Message, document.body);
```

## API

### Component

```jsx
import FlashMessage from 'react-flash-message';

// inside render
<FlashMessage duration={5000} persistOnHover={true}>
  <p>Message</p>
</FlashMessage>;
```

### Props

| Prop             | Type   | Default | Description                                                      |
| ---------------- | ------ | ------- | ---------------------------------------------------------------- |
| `duration`       | number | 5000    | Number of milliseconds the component will show                   |
| `persistOnHover` | bool   | true    | Will not remove the component when the user hovers on it if true |

## Issues

Feel free to contribute. Submit a Pull Request or open an issue for further discussion.

## License

MIT

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