Best Free JavaScript Modal Window Plugins

You can find plenty of pure CSS modals but these don’t offer the same control as JavaScript. With a JavaScript modal, you can add custom animations, UI inputs, and really enhance the user experience.

But, why design something from scratch when you can use a JS library? I have collected the best free JavaScript-powered modal scripts here for you to peruse and single out your favorites.

All of these are completely free and open-source, so you can edit the code and restyle them to fit your site as needed.

1. Tingle

Tingle.js pluginTingle.js plugin

One of my favorite free modal scripts is Tingle.js. It’s built on vanilla JavaScript with no dependencies, so you don’t need any jQuery or Zepto libraries.

Plus, it’s a fairly small library, although it does have a lot of options for customization. You can change the CSS transitions, the JavaScript modal animations, and the whole user experience with just a few settings.

Tingle.js is designed to be fully accessible and responsive, so it works on mobile devices and supports older browsers, too.

You can see all the documentation on GitHub, along with the free source code. They also have a demo link, so you can check out Tingle in action to see if it could fit on your website.

2. Vanilla Modal

Vanilla Modal JavaScript pluginVanilla Modal JavaScript plugin

Here’s a modal I just found recently and it’s a whole lot simpler than most. Vanilla Modal stands true to its name with a pure vanilla script powering the modal, along with CSS transitions.

This thing is pretty small and super flexible, with custom CSS to restyle the windows. It also has quite a few options you can alter with JavaScript, making it perfect for running DOM functions or even callback functions.

Take a peek at the demo page to see the default style. It’s a really basic design, so it’ll require customizations to use it on a production site. But this also cuts down on the total code requirements, so it’s one of the slimmest JavaScript modal libraries.

3. SweetAlert2

Sweetalert2 modalSweetalert2 modal

I loathe default JavaScript alerts because they’re just annoying and obtrusive. In this era of web design, we simply don’t need default browser alerts, especially with scripts like SweetAlert2.

This free JavaScript library comes with zero dependencies and works just like a modal window. However, it supports OK/Cancel inputs from the user, so you can design these and use them like alert boxes, too.

You won’t need any other scripts, so SweetAlert2 runs pretty light. Take a look at the demos to see how the modals look like in a real web page. SweetAlert2 is a perfect solution for stylish modal alert boxes.

4. plainModal

plainModal JavaScript pluginplainModal JavaScript plugin

If you want a really simple script I highly recommend plainModal. It is built on jQuery, but it’s one of the smallest modal scripts available.

It does not use any external CSS or image files. Just one single JS script is all you need.

Once the plainModal script is added to your page, you just target the modal button and you’re good to go. This grants you control over the display and how much you want to alter the modal interface.

Plus, you can set up the modal with one line of JavaScript keeping with the minimalist theme of this plugin.

5. Modaal

Modaal pluginModaal plugin

There’s no denying accessibility is huge on the web. Every designer’s goal should be a more inclusive experience for people around the world on various devices & with possible limitations.

With Modaal, you get that perfect experience which passes the WCAG 2.0 test with a solid AA accessibility rating. You can see a fantastic example on the main page, along with some code documentation.

Overall, I recommend this vanilla JavaScript plugin for anyone who really cares about accessibility. The AA rating can be required on some web projects, so Modaal is a really handy script to keep bookmarked.

6. Scotch JS Modal

Custom JavaScript Scotch.io tutorialCustom JavaScript Scotch.io tutorial

The development team at Scotch.io publish tutorials and guides for coders. Their work is incredible and it really shows in this JavaScript modal script, hosted on the Scotch GitHub.

The modal was developed by Ken Wheeler and this script even has a full tutorial if you want to learn how it works. However, the free code should be enough for most developers since this is super lightweight and easy to set up. No dependencies, and even a sample demo on CodePen.

7. Bootbox.js

Bootbox.js pluginBootbox.js plugin

The fastest way to launch a new web project is through Bootstrap. It’s a powerful frontend framework that encourages developers to create their own add-ons to the library.

One such example is Bootbox.js, a small JavaScript library, designed solely for modal windows in Bootstrap. It actually works on dialog boxes where the user can click OK or cancel, based on your request.

Typical JavaScript dialogs are awful, just like alert boxes. The Bootbox script offers a solid alternative for anyone working in the BS3/BS4 ecosystem.

Again, it’s totally free and open-source, along with a lengthy documentation page to get you up & running fast.

8. iziModal.js

iziModal.js pluginiziModal.js plugin

If you need a solution a little more customized check out iziModal.js. This tool is fully responsive and designed to work in all modern browsers perfectly.

I’ve yet to find another modal script that offers such an aesthetically pleasing design. It comes out the gate with a gorgeous UI that can blend into practically any website. However, you can also restyle the design to suit your needs.

Just note this plugin does run on jQuery, so it’s one of the few here that has a dependency. But, if you want the iziModal styles it’s a small price to pay for such sleek popover windows.

9. jQuery Modal

jQuery modaljQuery modal

The jQuery Modal plugin is perhaps the simplest modal script on jQuery you’ll ever find.

It can be programmed to automatically bind with certain HTML elements based on various attributes. It also supports keyboard shortcuts such as ESC for closing the window.

In total, this plugin measures less than 1KB and it works in every possible browser you can imagine. jQuery developers should keep this plugin saved for quick access to a simple modal script without the extra frills.

10. PicoModal

PicoModal pluginPicoModal plugin

Getting back towards vanilla JavaScript, we have the PicoModal library. This is probably one of the smallest scripts you’ll find and it’s designed to run perfectly on a vanilla JavaScript backbone.

It supports all modern browsers, including mobile browsers for Android and Mobile Safari for iOS. It even supports older IE browsers, dating back to IE7!

PicoModal’s developer created a small JSfiddle script to demonstrate how it works. This is a very small example and it’s not tied to a click event or anything else, but it’s not hard to script in a few toggle buttons to run this modal window properly.

11. Avgrund

Avgrund pluginAvgrund plugin

Avgrund is probably one of the most unique modals in this list. It uses a custom page fading effect, along with a shrinking animation to bring the modal right into view.

Not everyone will appreciate this animation, so I can’t say this script would fit every website. But, it is a pure vanilla modal and it’s super easy to set up, with just a CSS and a JavaScript file.

Take a look at the demo page to see how it runs. It’s certainly got a unique style and is bound to grab attention with the custom animations that just work.

Final words

No matter what you’re looking for, I’ll bet there’s something in this list to suit your needs. But, if you’re still not satisfied browse through GitHub for related modal scripts and see what else you can find.

Source: Hongkiat

(1168 Posts)

Leave a Reply