Remodal : jQuery Responsive & Flat Modal Window Plugin

Editor's note (2026): The original 2014 version of this post copied the Remodal README (with missing code). We've replaced it with a short overview and a working example. Remodal is no longer actively maintained; see modern alternatives at the end.

Remodal is a flat, responsive, lightweight jQuery plugin for modal windows. It's easy to customize, uses declarative HTML attributes, and supports hash tracking, so a modal can be opened with a URL like #modal.

Highlights

  • Small (about 4 KB minified)
  • Works in all modern browsers
  • Optional background blur effect
  • Also works with Zepto
  • Events for open, opened, close, closed, confirm, and cancel

Basic example

Include jQuery, remodal.css, a Remodal theme CSS file, and remodal.js, then add a modal:

<div class="remodal" data-remodal-id="modal">
  <button data-remodal-action="close" class="remodal-close" aria-label="Close"></button>
  <h2>Remodal</h2>
  <p>A flat, responsive, lightweight modal window.</p>
  <button data-remodal-action="cancel" class="remodal-cancel">Cancel</button>
  <button data-remodal-action="confirm" class="remodal-confirm">OK</button>
</div>

<a href="#modal">Open the modal</a>

Listen for events:

$(document).on('confirmation', '.remodal', function () {
  console.log('Confirmed');
});

Open or close it from code:

const inst = $('[data-remodal-id=modal]').remodal();
inst.open();
inst.close();

Options can be set with a data-remodal-options attribute containing valid JSON, for example to turn off hash tracking.

Modern alternatives

The native HTML <dialog> element now handles modals in all modern browsers, including focus management and the Escape key, without any plugin:

<dialog id="info">
  <p>Hello!</p>
  <form method="dialog"><button>Close</button></form>
</dialog>
<button onclick="document.getElementById('info').showModal()">Open</button>

Libraries like Micromodal and A11y Dialog are good accessible options too.


Need help building accessible, user-friendly website features? I.T. For Less can help — contact us.

I.T. Support