react-web-notifications
Version:
Simple web notifications component for React
43 lines (29 loc) • 871 B
Markdown
for React
[](https://nodei.co/npm/react-web-notifications/)
```
$ npm install react-web-notifications --save
```
```js
import WebNotification from 'react-web-notifications'
```
```js
<WebNotification
title="Hello, World!" // the title prop is required
icon="path/to/image.jpg"
body="This is a web notification"
timeout={9000}
onClickFn={ () => window.open('http://www.google.com/', '_blank') } // open your own site on notification click
/>
```
| Prop | Type | Required |
|-------|--------|----------|
| title | string | true |
| icon | string | false |
| body | string | false |
| timeout | number | false |
| onClickFn | function | false |
MIT
Simple web notifications component