Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

notiflix

notiflix28.7kMIT3.2.8TypeScript support: included

Notiflix is a dependency-free, secure, and lightweight JavaScript library built with pure JavaScript, offering client-side non-blocking notifications, popup boxes, loading indicators, and more.

notification, notifications, notiflix, notify, toast, alert, popup boxes, loading indicator, javascript alert, javascript confirm, confirm box, ui block, block ui element, react notifications, angular notifications, nextjs notifications, client-side, non-blocking, zero dependency

readme

Notiflix

Notiflix


NPM Version Known Vulnerabilities TypeScript Downloads jsDelivr License

Notiflix

Notiflix is a dependency-free, secure, and lightweight JavaScript library built with pure JavaScript, offering client-side non-blocking notifications, popup boxes, loading indicators, and more.

It is designed to enhance the user experience without the need for heavy dependencies, making it suitable for a wide variety of projects.

Current Version

3.2.8 *

Browser Compatibility

Chrome || Firefox || Safari || Edge || Opera || * Edge Legacy || * IE 10+

* SVG animations are not supported.


Documentation

https://notiflix.github.io/documentation

Modules (Demo/Playground)


(A) Install and Import

Install

yarn

yarn add notiflix

npm

npm i notiflix

Import

// all modules
import Notiflix from 'notiflix';

// one by one
import { Notify } from 'notiflix/build/notiflix-notify-aio';
import { Report } from 'notiflix/build/notiflix-report-aio';
import { Confirm } from 'notiflix/build/notiflix-confirm-aio';
import { Loading } from 'notiflix/build/notiflix-loading-aio';
import { Block } from 'notiflix/build/notiflix-block-aio';

(B) Add to an HTML page (Global)

CSS and JS

<link rel="stylesheet" href="dist/notiflix-3.2.8.min.css" />

<script src="dist/notiflix-3.2.8.min.js"></script>

or only JS (All in One - Internal CSS)

<script src="dist/notiflix-aio-3.2.8.min.js"></script>

or only Modules JS (All in One - Internal CSS)

<script src="dist/notiflix-notify-aio-3.2.8.min.js"></script>

<script src="dist/notiflix-report-aio-3.2.8.min.js"></script>

<script src="dist/notiflix-confirm-aio-3.2.8.min.js"></script>

<script src="dist/notiflix-loading-aio-3.2.8.min.js"></script>

<script src="dist/notiflix-block-aio-3.2.8.min.js"></script>

Usage

1- Notify Module

Notiflix Notify module can be used to send non-blocking alerts/notifications. This module includes 4 types of notifications: "Success", "Failure", "Warning", and "Info".

/*
* @param1 {string}: Required, a text in string format.
* @param2 {function | Object}: Optional, a callback function that will be called when the notification element has been clicked. Or, extending the initialize options with the new options for each notification element.
* @param3 {Object}: Optional, extending the initialize options with new the options for each notification element. (If the second parameter has been already used for a callback function.)
*/

// e.g. Only message
Notiflix.Notify.success('Sol lucet omnibus');

Notiflix.Notify.failure('Qui timide rogat docet negare');

Notiflix.Notify.warning('Memento te hominem esse');

Notiflix.Notify.info('Cogito ergo sum');

// e.g. Message with a callback
Notiflix.Notify.success(
  'Click Me',
  function cb() {
    // callback
  },
);

// e.g. Message with the new options
Notiflix.Notify.success(
  'Click Me',
  {
    timeout: 6000,
  },
);

// e.g. Message with callback, and the new options
Notiflix.Notify.success(
  'Click Me',
  function cb() {
    // callback
  },
  {
    timeout: 4000,
  },
);

------------------------------------

2- Report Module

Notiflix Report module can be used to show extended notifications that contain a title, description, and button(with a callback function). This module includes 4 types of notifications: "Success", "Failure", "Warning", and "Info".

/*
* @param1 {string}: Required, title text in string format.
* @param2 {string}: Required, message text in string format.
* @param3 {string}: Required, button text in string format.
* @param4 {function | Object}: Optional, a callback function that will be called when the button element has been clicked. Or, extending the initialize options with the new options for each notification element.
* @param5 {Object}: Optional, extending the initialize options with new the options for each notification element. (If the fourth parameter has been already used for a callback function.)
*/

// e.g. Only title, message, and button text
Notiflix.Report.success('Title', 'Message', 'Button Text');

Notiflix.Report.failure('Title', 'Message', 'Button Text');

Notiflix.Report.warning('Title', 'Message', 'Button Text');

Notiflix.Report.info('Title', 'Message', 'Button Text');

// e.g. With a callback
Notiflix.Report.success(
  'Title',
  'Message',
  'Button Text',
  function cb() {
    // callback
  },
);

// e.g. With the new options
Notiflix.Report.success(
  'Title',
  'Message',
  'Button Text',
  {
    width: '360px',
    svgSize: '120px',
  },
);

// e.g. With a callback, and the new options
Notiflix.Report.success(
  'Title',
  'Message',
  'Button Text',
  function cb() {
    // callback
  },
  {
    width: '360px',
    svgSize: '120px',
  },
);

------------------------------------

3- Confirm Module

Notiflix Confirm module can be used to show non-blocking confirm/prompt boxes. This module includes 3 types of prompts: "Show", "Ask", and "Prompt". An additional question can be asked within the prompt box if using the "Ask" and/or "Prompt" ones unlike the "Show" one.

Show:

This method can be used to show a confirm box with info, and take the custom actions via the callback functions.

/*
* @param1 {string}: Required, title text in string format.
* @param2 {string}: Required, message/question in string format.
* @param3 {string}: Required, OK button text in string format.
* @param4 {string}: Optional, Cancel button text in string format.
* @param5 {function}: Optional, a callback function that will be called when the OK button element has been clicked.
* @param6 {function}: Optional, a callback function that will be called when the Cancel button element has been clicked.
* @param7 {Object}: Optional, extending the initialize options with new the options for each confirm box.
*/

Notiflix.Confirm.show(
  'Notiflix Confirm',
  'Do you agree with me?',
  'Yes',
  'No',
  function okCb() {
    alert('Thank you.');
  },
  function cancelCb() {
    alert('If you say so...');
  },
  {
    width: '320px',
    borderRadius: '8px',
    // etc...
  },
);
Ask:

This method can be used to ask a question within a confirm box. The confirm box doesn't remove till the client gives the correct answer. Or, the client can click on the cancel button to close/remove the confirm box as well.

/*
* @param1 {string}: Required, title text in string format.
* @param2 {string}: Required, question text in string format.
* @param3 {string}: Required, answer text in string format.
* @param4 {string}: Required, OK button text in string format.
* @param5 {string}: Optional, Cancel button text in string format.
* @param6 {function}: Optional, a callback function that will be called when the OK button element has been clicked.
* @param7 {function}: Optional, a callback function that will be called when the Cancel button element has been clicked.
* @param8 {Object}: Optional, extending the initialize options with new the options for each confirm box.
*/

Notiflix.Confirm.ask(
  'Where is Padmé?',
  'Is she safe? Is she all right?',
  'It seems, in your anger, you killed her.',
  'Answer',
  'Cancel',
  function okCb() {
    alert('😡 NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!');
  },
  function cancelCb() {
    alert('😪 ...');
  },
  {
    // Custom options
  },
);
Prompt:

This method works similarly as window.prompt(). The client doesn't have to type a correct answer to the input element to proceed unlike the Notiflix.Confirm.ask(); method. The client answer passes to the callback functions as a parameter and this parameter is always a string.

/*
* @param1 {string}: Required, title text in string format.
* @param2 {string}: Required, question text in string format.
* @param3 {string}: Required, default answer text in string format. An empty string can be used as well.
* @param4 {string}: Required, OK button text in string format.
* @param5 {string}: Optional, Cancel button text in string format.
* @param6 {function}: Optional, a callback function that will be called when the OK button element has been clicked.
* @param7 {function}: Optional, a callback function that will be called when the Cancel button element has been clicked.
* @param8 {Object}: Optional, extending the initialize options with new the options for each confirm box.
*/

Notiflix.Confirm.prompt(
  'Hello',
  'How are you feeling?',
  'Awesome!',
  'Answer',
  'Cancel',
  function okCb(clientAnswer) {
    console.log('Client answer is: ' + clientAnswer);
  },
  function cancelCb(clientAnswer) {
    console.log('Client answer was: ' + clientAnswer);
  },
  {
    // Custom options
  },
);

------------------------------------

4- Loading Module

Notiflix Loading module can be used to show a loading indicator during a process (Fetch/XHR). Includes 6 types of animated SVG icons: "Standard", "Hourglass", "Circle", "Arrows", "Dots", and "Pulse". An additional type is "Custom", and it can be used with a custom SVG icon.

Show:

/*
* @param1 {string | Object}: Optional, a message in string format. Or, extending the initialize options with the new options for each loading indicator.
* @param2 {Object}: Optional, extending the initialize options with new the options for each loading indicator. (If the first parameter has been already used for a message.)
*/

// Only loading indicators
Notiflix.Loading.standard();
Notiflix.Loading.hourglass();
Notiflix.Loading.circle();
Notiflix.Loading.arrows();
Notiflix.Loading.dots();
Notiflix.Loading.pulse();

// Loading indicator with a message
Notiflix.Loading.standard('Loading...');

// Only loading indicator with the new options
Notiflix.Loading.standard({
  clickToClose: true,
  svgSize: '19px',
});

// Loading indicator with a message, and the new options
Notiflix.Loading.standard('Loading...', {
  backgroundColor: 'rgba(0,0,0,0.8)',
});

Change:

/*
* @param1 {string}: Required, new message in string format.
*/

Notiflix.Loading.change('Loading %20');

Remove:

/*
* @param1 {number}: Optional, milliseconds for delaying in number format.
*/

// Remove immediately
Notiflix.Loading.remove();

// Remove after delay => e.g. 1923ms
Notiflix.Loading.remove(1923);

Custom:

// Only custom loading indicator
Notiflix.Loading.custom({
  customSvgUrl: 'https://notiflix.github.io/content/media/loading/notiflix-loading-nx-light.svg',
});

// Custom loading indicator with a message
Notiflix.Loading.custom('Loading...', {
  customSvgUrl: 'https://notiflix.github.io/content/media/loading/notiflix-loading-nx-light.svg',
});


// Only custom loading indicator (A text-based SVG code)
Notiflix.Loading.custom({
  customSvgCode: '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">...</svg>',
});

// Custom loading indicator (A text-based SVG code) with a message
Notiflix.Loading.custom('Loading...', {
  customSvgCode: '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">...</svg>',
});

------------------------------------

5- Block Module

Notiflix Block module can be used to block/unblock the elements during a process (Fetch/XHR), without locking the browser or the other elements/components to prevent the user’s interactions on the blocked elements.

Block:

/*
* @param1 {string | Array<HTMLElement> | NodeListOf<HTMLElement>}: Required, CSS selector(s) that matches the element(s) | Array of HTMLElments | NodeListOf HTMLElments to block.
* @param2 {string | Object}: Optional, a blocking message in string format. Or, extending the initialize options with the new options for each block element.
* @param3 {Object}: Optional, extending the initialize options with new the options for each block element. (If the second parameter has been already used for a blocking message.)
*/

// Only indicators
Notiflix.Block.standard('.js-element');
Notiflix.Block.hourglass('.js-element');
Notiflix.Block.circle('.js-element');
Notiflix.Block.arrows('.js-element');
Notiflix.Block.dots('.js-element');
Notiflix.Block.pulse('.js-element');

// Indicator with a blocking message
Notiflix.Block.standard('.js-element', 'Please wait...');

// Only indicator with the new options
Notiflix.Block.standard('.js-element', {
  cssAnimationDuration: 1881,
  svgSize: '19px',
});

// Indicator with a blocking message, and the new options
Notiflix.Block.standard('.js-element', 'Please wait...', {
  backgroundColor: 'rgba(0,0,0,0.8)',
});

Unblock:

/*
* @param1 {string | Array<HTMLElement> | NodeListOf<HTMLElement>}: Required, CSS selector(s) that matches the element(s) | Array of HTMLElments | NodeListOf HTMLElments to unblock.
* @param2 {number}: Optional, milliseconds for delaying in number format.
*/

// Unblock immediately
Notiflix.Block.remove('.js-element');

// Unblock after delay => e.g. 1923ms
Notiflix.Block.remove('.js-element', 1923);

------------------------------------

Initialize (optional)

Notiflix.*.init function can be used to set custom options as globally.

// Notify
Notiflix.Notify.init({});

// Report
Notiflix.Report.init({});

// Confirm
Notiflix.Confirm.init({});

// Loading
Notiflix.Loading.init({});

// Block
Notiflix.Block.init({});


// e.g. Initialize the Notify Module with some options
Notiflix.Notify.init({
  width: '280px',
  position: 'right-top',
  distance: '10px',
  opacity: 1,
  // ...
});

------------------------------------

Merge (optional)

Notiflix.*.merge function can be used to deeply extend the init() options for a specific page or event globally.

// e.g. Merge the Notify Module's initialize options with some new options.
Notiflix.Notify.merge({
  width: '300px',
  // ...
});



Options

The default options of all modules.

Notiflix Notify Module: Default Options

Notiflix.Notify.init({
  width: '280px',
  position: 'right-top', // 'right-top' - 'right-bottom' - 'left-top' - 'left-bottom' - 'center-top' - 'center-bottom' - 'center-center'
  distance: '10px',
  opacity: 1,
  borderRadius: '5px',
  rtl: false,
  timeout: 3000,
  messageMaxLength: 110,
  backOverlay: false,
  backOverlayColor: 'rgba(0,0,0,0.5)',
  plainText: true,
  showOnlyTheLastOne: false,
  clickToClose: false,
  pauseOnHover: true,

  ID: 'NotiflixNotify',
  className: 'notiflix-notify',
  zindex: 4001,
  fontFamily: 'Quicksand',
  fontSize: '13px',
  cssAnimation: true,
  cssAnimationDuration: 400,
  cssAnimationStyle: 'fade', // 'fade' - 'zoom' - 'from-right' - 'from-top' - 'from-bottom' - 'from-left'
  closeButton: false,
  useIcon: true,
  useFontAwesome: false,
  fontAwesomeIconStyle: 'basic', // 'basic' - 'shadow'
  fontAwesomeIconSize: '34px',

  success: {
    background: '#32c682',
    textColor: '#fff',
    childClassName: 'notiflix-notify-success',
    notiflixIconColor: 'rgba(0,0,0,0.2)',
    fontAwesomeClassName: 'fas fa-check-circle',
    fontAwesomeIconColor: 'rgba(0,0,0,0.2)',
    backOverlayColor: 'rgba(50,198,130,0.2)',
  },

  failure: {
    background: '#ff5549',
    textColor: '#fff',
    childClassName: 'notiflix-notify-failure',
    notiflixIconColor: 'rgba(0,0,0,0.2)',
    fontAwesomeClassName: 'fas fa-times-circle',
    fontAwesomeIconColor: 'rgba(0,0,0,0.2)',
    backOverlayColor: 'rgba(255,85,73,0.2)',
  },

  warning: {
    background: '#eebf31',
    textColor: '#fff',
    childClassName: 'notiflix-notify-warning',
    notiflixIconColor: 'rgba(0,0,0,0.2)',
    fontAwesomeClassName: 'fas fa-exclamation-circle',
    fontAwesomeIconColor: 'rgba(0,0,0,0.2)',
    backOverlayColor: 'rgba(238,191,49,0.2)',
  },

  info: {
    background: '#26c0d3',
    textColor: '#fff',
    childClassName: 'notiflix-notify-info',
    notiflixIconColor: 'rgba(0,0,0,0.2)',
    fontAwesomeClassName: 'fas fa-info-circle',
    fontAwesomeIconColor: 'rgba(0,0,0,0.2)',
    backOverlayColor: 'rgba(38,192,211,0.2)',
  },
});

Notiflix Report Module: Default Options

Notiflix.Report.init({
  className: 'notiflix-report',
  width: '320px',
  backgroundColor: '#f8f8f8',
  borderRadius: '25px',
  rtl: false,
  zindex: 4002,
  backOverlay: true,
  backOverlayColor: 'rgba(0,0,0,0.5)',
  backOverlayClickToClose: false,
  fontFamily: 'Quicksand',
  svgSize: '110px',
  plainText: true,
  titleFontSize: '16px',
  titleMaxLength: 34,
  messageFontSize: '13px',
  messageMaxLength: 400,
  buttonFontSize: '14px',
  buttonMaxLength: 34,
  cssAnimation: true,
  cssAnimationDuration: 360,
  cssAnimationStyle: 'fade', // 'fade' - 'zoom'

  success: {
    svgColor: '#32c682',
    titleColor: '#1e1e1e',
    messageColor: '#242424',
    buttonBackground: '#32c682',
    buttonColor: '#fff',
    backOverlayColor: 'rgba(50,198,130,0.2)',
  },

  failure: {
    svgColor: '#ff5549',
    titleColor: '#1e1e1e',
    messageColor: '#242424',
    buttonBackground: '#ff5549',
    buttonColor: '#fff',
    backOverlayColor: 'rgba(255,85,73,0.2)',
  },

  warning: {
    svgColor: '#eebf31',
    titleColor: '#1e1e1e',
    messageColor: '#242424',
    buttonBackground: '#eebf31',
    buttonColor: '#fff',
    backOverlayColor: 'rgba(238,191,49,0.2)',
  },

  info: {
    svgColor: '#26c0d3',
    titleColor: '#1e1e1e',
    messageColor: '#242424',
    buttonBackground: '#26c0d3',
    buttonColor: '#fff',
    backOverlayColor: 'rgba(38,192,211,0.2)',
  },
});

Notiflix Confirm Module: Default Options

Notiflix.Confirm.init({
  className: 'notiflix-confirm',
  width: '300px',
  zindex: 4003,
  position: 'center', // 'center' - 'center-top' - 'center-bottom' - 'right-top' - 'right-center' - 'right-bottom' - 'left-top' - 'left-center' - 'left-bottom'
  distance: '10px',
  backgroundColor: '#f8f8f8',
  borderRadius: '25px',
  backOverlay: true,
  backOverlayColor: 'rgba(0,0,0,0.5)',
  rtl: false,
  fontFamily: 'Quicksand',
  cssAnimation: true,
  cssAnimationDuration: 300,
  cssAnimationStyle: 'fade', // 'zoom' - 'fade'
  plainText: true,

  titleColor: '#32c682',
  titleFontSize: '16px',
  titleMaxLength: 34,

  messageColor: '#1e1e1e',
  messageFontSize: '14px',
  messageMaxLength: 110,

  buttonsFontSize: '15px',
  buttonsMaxLength: 34,
  okButtonColor: '#f8f8f8',
  okButtonBackground: '#32c682',
  cancelButtonColor: '#f8f8f8',
  cancelButtonBackground: '#a9a9a9',
});

Notiflix Loading Module: Default Options

Notiflix.Loading.init({
  className: 'notiflix-loading',
  zindex: 4000,
  backgroundColor: 'rgba(0,0,0,0.8)',
  rtl: false,
  fontFamily: 'Quicksand',
  cssAnimation: true,
  cssAnimationDuration: 400,
  clickToClose: false,
  customSvgUrl: null,
  customSvgCode: null,
  svgSize: '80px',
  svgColor: '#32c682',
  messageID: 'NotiflixLoadingMessage',
  messageFontSize: '15px',
  messageMaxLength: 34,
  messageColor: '#dcdcdc',
});

Notiflix Block Module: Default Options

Notiflix.Block.init({
  querySelectorLimit: 200,
  className: 'notiflix-block',
  position: 'absolute',
  zindex: 1000,
  backgroundColor: 'rgba(255,255,255,0.9)',
  rtl: false,
  fontFamily: 'Quicksand',
  cssAnimation: true,
  cssAnimationDuration: 300,
  svgSize: '45px',
  svgColor: '#383838',
  messageFontSize: '14px',
  messageMaxLength: 34,
  messageColor: '#383838',
});



Copyright © 2019 - 2025 Notiflix

License

MIT license - https://opensource.org/licenses/MIT

changelog

@3.2.8

  • Changed:

    • Corrected grammar issues in comment lines.
    • Fixed(grammar) the name of an internal helper function:
      • removeNotifyElmentsAndWrapper => removeNotifyElementsAndWrapper
  • Fixed:

    • Fix on commonCheckHeadOrBody internal helper function, which was checking for null instead of undefined.
      • This overthought helper is intended to verify that window.document.head or window.document.body exists.

Happy new year!


@3.2.7

No changes.

Happy new year!


@3.2.6

No changes.

Happy new year!


@3.2.5

  • Added: Notiflix.Report.* module: backOverlayClickToClose option has been added. Default value is false. It removes the Report Notification when the background overlay element has been clicked. The existing backOverlay option has to be true as well. #48

  • Changed: Code Review/Refactor.


@3.2.4

  • Fixed: Notiflix.Block.*: The temporary position class name for the reference element has been changed to a constant text.

@3.2.3

  • Fixed: Notiflix.Block.*: The custom class name option was not being set correctly. The temporary position class name for the reference element was not being removed if it was being used with a custom class name.

@3.2.2

  • Fixed: Notiflix.Confirm.prompt(): Input maxlength attribute value should not be directly related to the default answer length.

@3.2.1

  • Fixed: index.d.ts:
    • Notiflix.Notify.* module: callbackOrOptions type definition issue has been fixed.
    • Notiflix.Report.* module: callbackOrOptions type definition issue has been fixed.

@3.2.0

  • Added: Notiflix.Confirm.* module: The .prompt() method has been added. (#42)

    • Notiflix.Confirm.prompt() method works similarly as window.prompt(). The client doesn't have to type a correct answer to the input element to proceed unlike the Notiflix.Confirm.ask() method. The client answer passes to the callback functions as a parameter and this parameter is always a string.
  • Added: Notiflix.Loading.* module: The customSvgCode option has been added for Notiflix.Loading.custom(); method. The default is null. A text-based (string) SVG icon can be set to this option. Single quotation marks should be avoided.

  • Fixed: index.d.ts: IConfirmOptions interface: zindex property type has been fixed.

  • Removed: index.d.ts: Following types have been removed:

    • TNotiflixCallback
    • TNotifyCallbackOrOptions
    • TReportCallbackOrOptions
    • TLoadingMessageOrOptions
    • TBlockMessageOrOptions
    • TBlockSelectorOrHTMLElements
  • Added: index.d.ts: Namespaces, Functions, and Interfaces: Comments have been added for IntelliSense.

  • Changed: Code Review/Refactor.


@3.1.0

  • Changed: Notiflix.Block.* module: The selector parameter has been changed to selectorOrHTMLElements. An Array<HTMLElement> or a NodeListOf<HTMLElement> can be also used instead of CSS selector(s).

  • Fixed: Notiflix.Notify.* module: The background overlay element was not being removed at the end of the call if the backOverlay option has been set/changed as a parameter option in the next notification instead of the global init function.

  • Changed: Notiflix.Notify.success: The childClassName option, default value has been changed from success to notiflix-notify-success.

  • Changed: Notiflix.Notify.failure: The childClassName option, default value has been changed from failure to notiflix-notify-failure.

  • Changed: Notiflix.Notify.warning: The childClassName option, default value has been changed from warning to notiflix-notify-warning.

  • Changed: Notiflix.Notify.info: The childClassName option, default value has been changed from info to notiflix-notify-info.

  • Changed: Auto-generated src/all-in-one/notiflix-aio.js file has been moved to the build directory. (with *.d.ts)

  • Added: Auto-generated build/notiflix-notify-aio.js (with *.d.ts), and dist/notiflix-notify-aio-3.1.0.min.js files have been added. These files are only for using the Notify module instead of using all the modules.

  • Added: Auto-generated build/notiflix-report-aio.js (with *.d.ts), and dist/notiflix-report-aio-3.1.0.min.js files have been added. These files are only for using the Report module instead of using all the modules.

  • Added: Auto-generated build/notiflix-confirm-aio.js (with *.d.ts), and dist/notiflix-confirm-aio-3.1.0.min.js files have been added. These files are only for using the Confirm module instead of using all the modules.

  • Added: Auto-generated build/notiflix-loading-aio.js (with *.d.ts), and dist/notiflix-loading-aio-3.1.0.min.js files have been added. These files are only for using the Loading module instead of using all the modules.

  • Added: Auto-generated build/notiflix-block-aio.js (with *.d.ts), and dist/notiflix-block-aio-3.1.0.min.js files have been added. These files are only for using the Block module instead of using all the modules.

  • Changed: The documentation website URL has been changed.

  • Changed: Code Review/Refactor.


@3.0.2

  • Changed: index.d.ts: Types and Interfaces have been exported.
  • Changed: Code Review.

@3.0.1

  • Changed: index.d.ts file has added to the NPM.

@3.0.0

  • Changed: Notiflix.Notify: Init() function name changed to init().
  • Changed: Notiflix.Notify: Merge() function name changed to merge().
  • Changed: Notiflix.Notify: Success() function name changed to success().
  • Changed: Notiflix.Notify: Failure() function name changed to failure().
  • Changed: Notiflix.Notify: Warning() function name changed to warning().
  • Changed: Notiflix.Notify: Info() function name changed to info().

  • Changed: Notiflix.Report: Init() function name changed to init().

  • Changed: Notiflix.Report: Merge() function name changed to merge().
  • Changed: Notiflix.Report: Success() function name changed to success().
  • Changed: Notiflix.Report: Failure() function name changed to failure().
  • Changed: Notiflix.Report: Warning() function name changed to warning().
  • Changed: Notiflix.Report: Info() function name changed to info().

  • Changed: Notiflix.Confirm: Init() function name changed to init().

  • Changed: Notiflix.Confirm: Merge() function name changed to merge().
  • Changed: Notiflix.Confirm: Show() function name changed to show().
  • Changed: Notiflix.Confirm: Ask() function name changed to ask().

  • Changed: Notiflix.Loading: Init() function name changed to init().

  • Changed: Notiflix.Loading: Merge() function name changed to merge().
  • Changed: Notiflix.Loading: Standard() function name changed to standard().
  • Changed: Notiflix.Loading: Hourglass() function name changed to hourglass().
  • Changed: Notiflix.Loading: Circle() function name changed to circle().
  • Changed: Notiflix.Loading: Arrows() function name changed to arrows().
  • Changed: Notiflix.Loading: Dots() function name changed to dots().
  • Changed: Notiflix.Loading: Pulse() function name changed to pulse().
  • Changed: Notiflix.Loading: Custom() function name changed to custom().
  • Changed: Notiflix.Loading: Notiflix() function name changed to notiflix().
  • Changed: Notiflix.Loading: Remove() function name changed to remove().
  • Changed: Notiflix.Loading: Change() function name changed to change().

  • Changed: Notiflix.Block: Init() function name changed to init().

  • Changed: Notiflix.Block: Merge() function name changed to merge().
  • Changed: Notiflix.Block: Standard() function name changed to standard().
  • Changed: Notiflix.Block: Hourglass() function name changed to hourglass().
  • Changed: Notiflix.Block: Circle() function name changed to circle().
  • Changed: Notiflix.Block: Arrows() function name changed to arrows().
  • Changed: Notiflix.Block: Dots() function name changed to dots().
  • Changed: Notiflix.Block: Pulse() function name changed to pulse().
  • Changed: Notiflix.Block: Remove() function name changed to remove().

  • Changed: Notiflix.Notify.* module: useGoogleFont options has been deprecated.

  • Changed: Notiflix.Report.* module: useGoogleFont options has been deprecated.
  • Changed: Notiflix.Confirm.* module: useGoogleFont options has been deprecated.
  • Changed: Notiflix.Loading.* module: useGoogleFont options has been deprecated.
  • Changed: Notiflix.Block.* module: useGoogleFont options has been deprecated.

  • Added: TypeScript declaration has added.

  • Changed: Code Review.



@2.7.0

  • Added: Notiflix.Notify.* module: The pauseOnHover option has been added. The default value is true. Auto-remove functionality will be paused for each notification element when the pointer(mouse) enters the notification if this option has been set as true.

  • Changed: Notiflix.Notify.* module: Display improvements.

  • Changed: Notiflix.Block.* module: Code Review.


@2.6.0

  • Fixed: Notiflix.Confirm.* module: display and position issues have been fixed.

  • Added: Notiflix.Confirm.* module: New position settings have been added. center-bottom, right-center, and left-center.

  • Changed: Notiflix.Report.* module: display and position improvements.

  • Changed: Notiflix.Block.* module: Code Review.


@2.5.0

  • Added: Notiflix.Confirm.* module: The options parameter has been added to extend the initialize settings with new options for each Confirm Box.

  • Added: Notiflix.Confirm.* module: The .Ask() function has been added.

    • Notiflix.Confirm.Ask() function can be used to prevent the accidental click to the Ok button by the user before answering a simple question that has been created by you. (Please click here to see an example of usage.)
  • Changed: All the SVG icons have been compressed to reduce the file size as much as it can be.


@2.4.0

  • Added: Notiflix.Loading.* module: The message parameter has been extended, and the options parameter has been added.

    • Custom options can be used for each Loading element to extend the initialize settings.

      `js // Only indicator Notiflix.Loading.Standard();

      // Loading indicator with a message Notiflix.Loading.Standard('Loading...');

// NEW: v2.4.0 and the next versions
// Loading indicator with the new options
Notiflix.Loading.Standard(
  {
    svgSize: '19px',
  },
);

// NEW: v2.4.0 and the next versions
// Loading indicator with a message, and the new options
Notiflix.Loading.Standard(
  'Loading...',
  {
    svgSize: '23px',
  },
);
```
  • Added: Notiflix.Block.* module: The message parameter has been extended, and the options parameter has been added.

    • Custom options can be used for each Block element to extend the initialize settings.
  • Changed: Code Review.


@2.3.3

  • Changed: Code Review.
  • Changed: Prefixes for CSS.

@2.3.2

  • Fixed: Notiflix.Block.* module, Remove() function fixes and improvements for Internet Explorer(10+) compatibility.

  • Changed: "notiflix-aio.js" file has been moved from "src" to "src/all-in-one" folder.


@2.3.1

  • Changed: Notiflix.Notify.* module, callback and options parameters have been changed.

    • Custom options can be used for each Notify element to extend the initialize settings.

      // e.g. Message with a callback
      Notiflix.Notify.Success(
        'Click Me',
        function(){
          // callback
        },
      );
      
      // NEW: v2.3.1 and the next versions
      // e.g. Message with the new options
      Notiflix.Notify.Success(
        'Click Me',
        {
          timeout: 6000,
        },
      );
      
      // NEW: v2.3.1 and the next versions
      // e.g. Message with callback, and the new options
      Notiflix.Notify.Success(
        'Click Me',
        function(){
          // callback
        },
        {
          timeout: 4000,
        },
      );
  • Changed: Notiflix.Report.* module, callback and options parameters have been changed.

  • Changed: Code Review.


@2.3.0

  • Added: Notiflix.Notify.* module, optionsOrCallback parameter has been added. (Recommended by VirgilioGM)
  • Added: Notiflix.Report.* module, optionsOrCallback parameter has been added.
  • Changed: Code Review.

@2.2.1

  • Changed: Notiflix.Notify.* module, CSS animation improvements.

@2.2.0

  • Added:

    • Notiflix.Notify.* module; center-top, center-bottom, and center-center options have been added to the position setting. (Recommended by Sebastian Stavar)

    • Notiflix.Notify.* module; backOverlayColor option has been added to each type of notification. Can be set different background overlay colors for each type of notification now. (Recommended by Sebastian Stavar)

      // e.g.
      
      Notiflix.Notify.Init({
        // ...
        backOverlay: true, // default is false
        backOverlayColor: 'rgba(0,0,0,0.5)', // default back overlay color
        // ...
        success: {
          backOverlayColor: 'rgba(50,198,130,0.2)', // NEW: override the back overlay color
        },
        failure: {
          backOverlayColor: 'rgba(255,85,73,0.2)', // NEW: override the back overlay color
        },
        // ...
      });
    • Notiflix.Report.* module; backOverlayColor option has been added to each type of dialog box. Can be set different background overlay colors for each type of notification now.

      e.g.

      Notiflix.Report.Init({
        success: {
          backOverlayColor: 'rgba(50,198,130,0.2)', // NEW: override the back overlay color
        },
        failure: {
          backOverlayColor: 'rgba(255,85,73,0.2)', // NEW: override the back overlay color
        },
        // ...
      });
  • Changed: All modules (Notify, Report, Confirm, Loading, and Block); useGoogleFont setting has been changed as false to default.

  • Changed: Code Review.


@2.1.4

  • Changed: Code Review.
  • Changed: Notiflix Confirm module; HTML tag of the message element has been changed from "p" to "div".

@2.1.3

  • Changed: Code Review.

@2.1.2

  • Fixed: Document Object Model definition fixes.
  • Changed: Code Review.

@2.1.1

  • Fixed: Document Object Model definition fixes.
  • Changed: Code Review.

@2.1.0

  • Added: Universal Module Definition.

@2.0.0

Notiflix v2 is ready to use.

This version includes a new module name as Block.

Notiflix.Block.* module can be used to block or unblock elements to prevents users actions during the process (AJAX etc.) without locking the browser or the other elements.

  • Added: The Block module added to Notiflix.

  • Added: The clickToClose option added to the Notiflix.Notify.* module. Default is false. This option can be set as true to remove each notification without waiting for it to be automatically removed when it has been clicked. (Recommended by Mustafa Sadedil)

  • Changed: Code Review.






@1.9.1

  • Changed: Code Review.

@1.9.0

  • Changed: Code Review.

@1.8.0

  • Added: The "showOnlyTheLastOne" option added to the "Notiflix Notify" module. (Recommended by Ori Granot)

(Default is "false". This option can be set as "true" to show only the last notification.)


@1.7.2

  • Added: Unminified package published.

@1.7.1

  • Changed: Character encoding UTF-8 without BOM.

@1.7.0

  • Added: An optional callback function can be used with Deny Button in "Notiflix Confirm" module. (Recommended by Sinan Keskin)

@1.6.0

  • Changed: Code Review.

  • Added: All modules can be used even if they didn't initialized. The first call will initialize the module once. (With default settings.)


@1.5.0

  • Fixed: When the "useGoogleFont" option set as "false"; the "fontFamily" option was being ineffective.

@1.4.0

  • Changed: Code Review.

@1.3.0

  • Added: The "plainText" options added to "Notiflix Notify" and "Notiflix Confirm" modules.

(The "plainText" options can be set as "false" to use HTML allowed contents. Default values are "true" and not allowed HTML)


@1.2.0

  • Changed: JavaScript event listener improvements.

@1.1.0

  • Fixed: When used with Bootstrap, CSS fade animation class name was conflicting with some of Bootstrap class names. (Reported by Hasim Yerli)