SkillAgentSearch skills...

Pnotify

Beautiful JavaScript notifications with Web Notifications support.

Install / Use

/learn @sciactive/Pnotify
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align="center"> <img src="includes/logo.png" alt="PNotify" /> <div> <a href="https://www.npmjs.com/package/pnotify"><img src="https://img.shields.io/npm/v/pnotify.svg?style=flat&label=npm+version" title="npm version" /></a> <a href="https://github.com/sciactive/pnotify/blob/master/packages/core/index.d.ts"><img src="https://img.shields.io/npm/types/@pnotify/core.svg?style=flat" title="types" /></a> <a href="https://github.com/sciactive/pnotify/blob/master/LICENSE"><img src="https://img.shields.io/github/license/sciactive/pnotify.svg?style=flat" title="license" /></a> </div> <div> v4: <a href="https://www.npmjs.com/package/pnotify"><img src="https://img.shields.io/npm/dm/pnotify.svg?style=flat&label=npm+downloads" title="npm downloads" /></a> <a href="https://www.jsdelivr.com/package/npm/pnotify"><img src="https://img.shields.io/jsdelivr/npm/hm/pnotify.svg?style=flat" title="jsDelivr Hits" /></a> </div> <div> v5: <a href="https://www.npmjs.com/package/@pnotify/core"><img src="https://img.shields.io/npm/dm/@pnotify/core.svg?style=flat&label=npm+downloads" title="npm downloads" /></a> <a href="https://www.jsdelivr.com/package/npm/@pnotify/core"><img src="https://img.shields.io/jsdelivr/npm/hm/@pnotify/core.svg?style=flat" title="jsDelivr Hits" /></a> </div> </div>

A JavaScript/TypeScript notification, confirmation, and prompt library.

Notifications can display as toast style, snackbar style, banners, dialogs, alerts, or desktop notifications (using the Web Notifications spec) with fall back to an in-browser notice.

PNotify provides a unique notification flow called modalish that provides a good user experience, even when many notifications are shown at once.

<h1>Demos</h1>

Latest Stable - http://sciactive.com/pnotify/

Development - https://sciactive.github.io/pnotify/

<h1>Table of Contents</h1> <!-- TOC START min:1 max:3 link:true asterisk:false update:true --> <!-- TOC END -->

Getting Started

You can get PNotify using NPM or Yarn. (You can also use jsDelivr.)

You should install the packages you need individually. Alternatively, you can install all of them at once with the pnotify package.

# Install the packages you need individually.

# You definitely need this one.
npm install --save-dev @pnotify/core
# These are the optional ones.
npm install --save-dev @pnotify/animate
npm install --save-dev @pnotify/bootstrap3
npm install --save-dev @pnotify/bootstrap4
npm install --save-dev @pnotify/confirm
npm install --save-dev @pnotify/countdown
npm install --save-dev @pnotify/desktop
npm install --save-dev @pnotify/font-awesome4
npm install --save-dev @pnotify/font-awesome5-fix
npm install --save-dev @pnotify/font-awesome5
npm install --save-dev @pnotify/glyphicon
npm install --save-dev @pnotify/mobile
npm install --save-dev @pnotify/paginate

# ...

# Or, you can install this to get them all.
npm install --save-dev pnotify

Documentation for Old Versions

Migrating from PNotify 4

Installation

In addition to the JS and CSS, be sure to include a PNotify style.

Svelte

PNotify in Svelte.

import { alert, defaultModules } from '@pnotify/core';
import * as PNotifyMobile from '@pnotify/mobile';

defaultModules.set(PNotifyMobile, {});

alert({
  text: 'Notice me, senpai!',
});

React

PNotify in React.

import { alert, defaultModules } from '@pnotify/core';
import '@pnotify/core/dist/PNotify.css';
import * as PNotifyMobile from '@pnotify/mobile';
import '@pnotify/mobile/dist/PNotifyMobile.css';

defaultModules.set(PNotifyMobile, {});

alert({
  text: 'Notice me, senpai!',
});

Angular

PNotify in Angular.

import { alert, defaultModules } from '@pnotify/core';
import '@pnotify/core/dist/PNotify.css';
import * as PNotifyMobile from '@pnotify/mobile';
import '@pnotify/mobile/dist/PNotifyMobile.css';

defaultModules.set(PNotifyMobile, {});

//...
export class WhateverComponent {
  constructor() {
    alert({
      text: 'Notice me, senpai!',
    });
  }
}

<small>For IE support, see this issue.</small>

Angular (Injectable)

PNotify in Angular (Injectable)

// pnotify.service.ts
import { Injectable } from '@angular/core';
import { alert, defaultModules } from '@pnotify/core';
import '@pnotify/core/dist/PNotify.css';
import * as PNotifyMobile from '@pnotify/mobile';
import '@pnotify/mobile/dist/PNotifyMobile.css';

defaultModules.set(PNotifyMobile, {});

@Injectable()
export class PNotifyService {
  getPNotifyAlert() {
    return alert;
  }
}

// whatever.module.ts
//...
import { PNotifyService } from './pnotify.service';
@NgModule({
  declarations: [...],
  imports: [...],
  providers: [PNotifyService],
  bootstrap: [...]
})
export class WhateverModule {}

// whatever.component.ts
import { PNotifyService } from './pnotify.service';
//...
export class WhateverComponent {
  alert = undefined;
  constructor(pnotifyService: PNotifyService) {
    this.alert = pnotifyService.getPNotifyAlert();
    this.alert({
      text: 'Notice me, senpai!'
    });
  }
}

AngularJS

PNotify in AngularJS.

<link
  href="node_modules/@pnotify/core/dist/PNotify.css"
  rel="stylesheet"
  type="text/css"
/>
<link
  href="node_modules/@pnotify/mobile/dist/PNotifyMobile.css"
  rel="stylesheet"
  type="text/css"
/>
var angular = require('angular');
var PNotify = require('@pnotify/core');
var PNotifyMobile = require('@pnotify/mobile');

PNotify.defaultModules.set(PNotifyMobile, {});

angular
  .module('WhateverModule', [])
  .value('PNotify', PNotify)
  .controller('WhateverController', [
    'PNotify',
    function (PNotify) {
      PNotify.alert({
        text: 'Notice me, senpai!',
      });
    },
  ]);

Vanilla JS (ES5)

PNotify in vanilla ES5

<script
  type="text/javascript"
  src="node_modules/@pnotify/core/dist/PNotify.js"
></script>
<link
  href="node_modules/@pnotify/core/dist/PNotify.css"
  rel="stylesheet"
  type="text/css"
/>
<script
  type="text/javascript"
  src="node_modules/@pnotify/mobile/dist/PNotifyMobile.js"
></script>
<link
  href="node_modules/@pnotify/mobile/dist/PNotifyMobile.css"
  rel="stylesheet"
  type="text/css"
/>
<script type="text/javascript">
  PNotify.defaultModules.set(PNotifyMobile, {});

  PNotify.alert({
    text: 'Notice me, senpai!',
  });
</script>

Vanilla JS (ES6)

PNotify in vanilla ES6+

<link
  href="node_modules/@pnotify/core/dist/PNotify.css"
  rel="stylesheet"
  type="text/css"
/>
<link
  href="node_modules/@pnotify/mobile/dist/PNotifyMobile.css"
  rel="stylesheet"
  type="text/css"
/>
<script type="module">
  import {
    alert,
    defaultModules,
  } from 'node_modules/@pnotify/core/dist/PNotify.js';
  import * as PNotifyMobile from 'node_modules/@pnotify/mobile/dist/PNotifyMobile.js';

  defaultModules.set(PNotifyMobile, {});

  alert({
    text: 'Notice me, senpai!',
  });
</script>

Styles

Bright Theme

The default theme, Bright Theme. Supports dark mode. Include the CSS file in your page:

<link
  href="node_modules/@pnotify/core/dist/BrightTheme.css"
  rel="stylesheet"
  type="text/css"
/>

Or if you're using a packager that imports CSS:

import '@pnotify/core/dist/BrightTheme.css';

Material

The Material theme. Supports dark mode. Requires material-design-icons and optionally the Roboto font. Include the CSS file in your page:

<link
  href="node_modules/@pnotify/core/dist/Material.css"
  rel="stylesheet"
  type
View on GitHub
GitHub Stars3.6k
CategoryCustomer
Updated5d ago
Forks508

Languages

HTML

Security Score

100/100

Audited on Mar 27, 2026

No findings