Minimal Confirmation Modal Dialog In JavaScript – Confirmo

Category: Javascript , Modal & Popup | December 1, 2020
Author: EdinyangaOttoho
Views Total: 332 views
Official Page: Go to website
Last Update: December 1, 2020
License: MIT


Minimal Confirmation Modal Dialog In JavaScript – Confirmo


Confirmo is a minimal clean confirm modal dialog component that can be used to ask your users to confirm before performing an action.

How to use it:

1. Import the Confirmo’s JavaScript and CSS files into the page.

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

2. Create a new instance of the Confirmo and config the confirm dialog using the following props.

  yesBg: 'green',
  noBg: 'red',
  backColor: 'black',
  textColor: 'white'

3. Show the confirm dialog on the screen, define the confirm message, and determine the action to trigger as follows:{
  msg: "Replace this text with what you want to prompt!",
  callback: function (){
    // confirmed

4. You can also customize the confirm dialog via only HTML data attributes:

<button confirmo-message="Hello world" 
function hello(){

You Might Be Interested In:

Leave a Reply