1.0.0 • Published 7 years ago
react-notif v1.0.0
React Notif
React component for the Web Notifications API with in-browser fallback
npm i react-notif
// example
const Notif = require('react-notif')
const FallbackNotification = require('./FallbackNotification')
const App = () => (
<Notif
title='Hello there!'
options={{
body: 'How’s it going?',
image: 'hello.png'
}}
onClick={e => {
console.log('clicked')
}}
>
<FallbackNotification />
</Notif>
)
Props
title
- string - Notification title stringoptions
- object - passed to the Notification constructoronClick
- function - callback for when the notification has been clickedforceFallback
- boolean - skip the Notifications API and show fallback
1.0.0
7 years ago