rfm
react-flash-message
npm i react-flash-message
rfm

react-flash-message

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

by Daniel Sneijers

1.0.8 (see all)License:MITTypeScript:Not Found
npm i react-flash-message
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 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

Downloads/wk

1.5K

GitHub Stars

16

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
1.0.8
latest
1yr ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate