1.0.8 • Published 2 years ago

react-flash-message v1.0.8

Weekly downloads
1,173
License
MIT
Repository
github
Last release
2 years ago

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 for that.

Basic Example

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

import FlashMessage from 'react-flash-message';

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

Props

PropTypeDefaultDescription
durationnumber5000Number of milliseconds the component will show
persistOnHoverbooltrueWill 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

1.0.8

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago