DEV Community

Mitesh Kamat
Mitesh Kamat

Posted on

1

Library for modals, dialogs and alerts

Introduction

This post is about a ui library for modal popup.

Every now and then for a requirement involving modal popups, alert or prompts we tend to go for bootstrap as it also gives us grid layouts, utilities and handful of components to leverage.

It was not different in my case. But then, I stumbled upon a library name jQuery-confirm which had unique use cases. So, I decided to make use of this library.

My minimum usecases were:

It should be customizable from UI standpoint

It doesnot disappoint as you get:

  1. nice style options, drag feature, color options.
  2. theme options like light,dark, modern, material,etc.
  3. animation support
  4. auto close feature

It should have something for AJAX requests

With jconfirm you have the power to load content directly when needed via ajax, no extra code.
Two methods are available to load content via Ajax:

  1. Pass in String content the URL with "URL:" prepended. content: "URL:http://example.com/getData?id=1"
  2. Pass in Function that returns a jQuery ajax promise. content: function(){ return $.get(...); }

Lastly proper documentation with examples

Do give it a try as it happens to be a nice alternative with cool features.

Cheers !!!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay