🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

reactjs-push-notification

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactjs-push-notification

A solution for pushing browser web notification!

2.1.6
latest
Source
npm
Version published
Maintainers
1
Created
Source

Reactjs Push Notifications

A solution for pushing browser web notification! reactjs-push-notification is an npm package that allows you to push notifications to the browser. It can be used with both Next.js and React.js. The package is easy to use and provides a variety of customization options.

Features

  • It is open source and licensed under the MIT license.
  • It is compatible with React.js 16.8+ and Next.js 9.5+.
  • It has been tested in Chrome, Firefox, and Safari.
  • It is well-documented and includes examples.

Installing

$ npm install reactjs-push-notification

Example

import { pushNotification, NotificationPrompt } from "reactjs-push-notification";

const Push = () => {
    const buttonClick = () => {
        pushNotification({
            title: "Warning",
            subtitle: "This is a subtitle!",
            message: "This is a long message!"
        });
    };
    return (
        <div className="page">
            <NotificationPrompt />
            <button onClick={buttonClick} className="button">
                Push Notifications
            </button>
        </div>
    );
};

export default Push;

Options

Name Is Required Default
title Required (String) Notification Title
subtitle Optional (String) Notification Subtitle
message Optional (String) Notification Message Body
onClick Optional (Function)
duration Optional (Number) Notification Duration Time

Stay in touch

  • Author - Siam Ahnaf
  • Website - https://www.siamahnaf.com/
  • Twitter - https://twitter.com/siamahnaf198
  • Github - https://github.com/siamahnaf

FAQs

Package last updated on 18 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts