1.0.0 • Published 7 years ago

react-notif v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

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 string
  • options - object - passed to the Notification constructor
  • onClick - function - callback for when the notification has been clicked
  • forceFallback - boolean - skip the Notifications API and show fallback