$ npm install rjsnotify
import Notification, { notify } from 'rjsnotify';
const App = () => {
const showNotification = () => {
notify({ message: 'Hello world', placement: 'TOP_RIGHT', type: 'info' });
};
return (
<div>
<Notification />
<button onClick={showNotification}>notify</button>
</div>
);
};
Name | Type | Default | Required |
---|---|---|---|
message | string | true | |
placements | string | "TOP_LEFT" | false |
duration | number | 1500 | false |
type | string | false |
- TOP_LEFT
- TOP_RIGHT
- BOTTOM_LEFT
- BOTTOM_RIGHT
- danger
- success
- info
- warning
- CSS transitions
- Rendering custom elements
- Pause on hover
Clone this repository make a pull request to develop
branch
MIT ❤️