Categories: CSSScriptWeb Design

Elegant Notice Bar With Progress Bar – notice.js

notice.js is a small vanilla JavaScript notification plugin to display stackable temporary notice bars with progress bars representing the remaining time.

More features:

  • 4 preset types.
  • Modal mode: shows a background overlay when the notification is opened.
  • LTR or RTL support.
  • Custom open/close animations.

How to use it:

Install & download the package.

# NPM
$ npm install notice.js --save

Link to the necessary JavaScript and CSS files.

<link href="noticejs.css" rel="stylesheet">
<script src="notice.js"></script>

Create a new notification instance.

const instance = new NoticeJs({
      title: 'Notification title',
      text: 'Notification message'
})

Show the notification on the page.

instance.show();

Set the animation type. Available types:

  • Success (default)
  • Info
  • Warning
  • Error
const instance = new NoticeJs({
      title: 'Notification title',
      text: 'Notification message',
      type: 'error'
})

Set the position of the notification. Default: ‘topRight’.

const instance = new NoticeJs({
      title: 'Notification title',
      text: 'Notification message',
      position: 'topLeft'
})

Set the duration of the notification. Default: 3 seconds.

const instance = new NoticeJs({
      title: 'Notification title',
      text: 'Notification message',
      timeout: 30
})

Add extra CSS3 animations to the notification. In this example, we’re going to use Animate.css for the animations.

const instance = new NoticeJs({
      title: 'Notification title',
      text: 'Notification message',
      animation: {
        open: 'animated bounceInRight',
        close: 'animated bounceOutLeft'
      }
})

More configuration options.

const instance = new NoticeJs({
      title: 'Notification title',
      text: 'Notification message',
      newestOnTop: false,
      timeout: 30,
      progressBar: true,
      closeWith: ['button'],
      modal: true,
      width: 320,
      scroll: {
        maxHeightContent: 300,
        showOnHover: true
      },
      rtl: false
})

Callback functions.

const instance = new NoticeJs({
      title: 'Notification title',
      text: 'Notification message',
      callbacks: {
        beforeShow: [],
        onShow: [],
        afterShow: [],
        onClose: [],
        afterClose: [],
        onClick: [],
        onHover: [],
        onTemplate: []
      }
})

Changelog:

v0.5.0 (11/02/2025)

  • Update

The post Elegant Notice Bar With Progress Bar – notice.js appeared first on CSS Script.

rssfeeds-admin

Share
Published by
rssfeeds-admin

Recent Posts

Indy Unveils $48 million In Road Upgrades

INDIANAPOLIS, Ind. (WOWO) — The Indianapolis Metropolitan Planning Organization (IMPO) has announced a $48 million…

28 minutes ago

Rain Threatens Qualifying

INDIANAPOLIS, Ind. (WOWO) — Forecasters are tracking an increasing chance of rain at the Indianapolis…

28 minutes ago

This Week’s Episode of The Boys Features a Foul-Mouthed Marvel Studios Actor Cameo

Spoilers of course follow for The Boys Season 5, Episode 7.With Prime Video's The Boys…

3 hours ago

Gas-Tax Pause Talks

FORT WAYNE, Ind. (WOWO) — After President Trump signaled support for suspending the 18-cent federal…

3 hours ago

Katherine Legge Tries The Double

INDIANAPOLIS, Ind. (WOWO) — Katherine Legge will become the first woman to try and complete…

3 hours ago

US Senate again rejects resolution to force authorization for Iran war

The U.S. Capitol is pictured on March 3, 2026. (Photo by Jennifer Shutt/States Newsroom)WASHINGTON —…

4 hours ago

This website uses cookies.