Easily Build Confirmation Popups with the confirmDialog.js Library

Category: Javascript , Modal & Popup | March 24, 2024
Author:izisaurio
Views Total:38 views
Official Page:Go to website
Last Update:March 24, 2024
License:MIT

Preview:

Easily Build Confirmation Popups with the confirmDialog.js Library

Description:

A compact and sleek JavaScript library for building custom confirmation dialogs that enhance user experience. Built-in support for 5 languages (English, French, Spanish, German, Portuguese) and easy expansion for global reach.

How to use it:

1. Download and import the confirmDialog.js script.

<script src="confirmDialog.js"></script>

2. Create a new confirm dialog instance.

const dialog = new ConfirmDialog({
      message: 'Do you want to confirm this action?',
      ok: 'Ok',
      cancel: 'Cancel'
});

3. Display a confirm dialog on the page. It will return Promises to handle user confirmation or cancellation actions.

dialog.show('Are You Sure?').then((result) => {
  console.log(result.ok);
});

Changelog:

03/24/2024

  • Refactor

You Might Be Interested In:


Leave a Reply