Convert Figma logo to code with AI

vodkabears logoRemodal

No longer actively maintained.

2,759
773
2,759
65

Top Related Projects

3,293

No longer actively maintained.

A light-weight, customizable lightbox plugin for jQuery

Light and responsive lightbox script with focus on performance.

Featherlight is a very lightweight jQuery lightbox plugin. It's simple yet flexible and easy to use. Featherlight has minimal css and uses no inline styles, everything is name-spaced, it's completely customizable via config object and offers image, ajax and iframe support out of the box. Featherlights small footprint weights about 4kB – in total.

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. πŸ‡ΊπŸ‡¦

Quick Overview

Remodal is a responsive, lightweight, and customizable modal window plugin for jQuery and Zepto.js. It provides an easy way to create modal dialogs with a modern look and feel, supporting various animations and customization options.

Pros

  • Lightweight and fast, with minimal dependencies
  • Responsive design that works well on mobile devices
  • Customizable appearance and behavior through CSS and JavaScript options
  • Supports keyboard navigation and accessibility features

Cons

  • Requires jQuery or Zepto.js, which may not be ideal for all projects
  • Limited built-in styling options, requiring custom CSS for advanced designs
  • Not actively maintained, with the last update in 2017
  • Lacks some advanced features found in more comprehensive modal libraries

Code Examples

Creating a basic modal:

<div class="remodal" data-remodal-id="modal">
  <button data-remodal-action="close" class="remodal-close"></button>
  <h1>Modal Title</h1>
  <p>Modal content goes here.</p>
  <button data-remodal-action="confirm" class="remodal-confirm">OK</button>
  <button data-remodal-action="cancel" class="remodal-cancel">Cancel</button>
</div>

Opening a modal programmatically:

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

Listening for modal events:

$(document).on('opening', '.remodal', function () {
  console.log('Modal is opening');
});

$(document).on('closed', '.remodal', function () {
  console.log('Modal is closed');
});

Getting Started

  1. Include the necessary files in your HTML:
<link rel="stylesheet" href="path/to/remodal.css">
<link rel="stylesheet" href="path/to/remodal-default-theme.css">
<script src="path/to/jquery.min.js"></script>
<script src="path/to/remodal.min.js"></script>
  1. Create a modal in your HTML:
<div class="remodal" data-remodal-id="modal">
  <button data-remodal-action="close" class="remodal-close"></button>
  <h1>My Modal</h1>
  <p>Content goes here.</p>
  <button data-remodal-action="confirm" class="remodal-confirm">OK</button>
</div>
  1. Open the modal using a link or button:
<a href="#modal">Open modal</a>
  1. Initialize Remodal (optional, for custom options):
$('[data-remodal-id=modal]').remodal({
  hashTracking: false,
  closeOnOutsideClick: false
});

Competitor Comparisons

3,293

No longer actively maintained.

Pros of Vide

  • Focuses on video backgrounds, providing a more specialized solution
  • Lighter weight and simpler to use for video-specific needs
  • Better performance for video-related tasks

Cons of Vide

  • Less versatile compared to Remodal's modal functionality
  • Limited to video backgrounds, not suitable for general modal needs
  • Fewer customization options for non-video elements

Code Comparison

Vide:

$('#myBlock').vide('path/to/video');
$('#myBlock').vide('path/to/video', {
  volume: 0.3,
  playbackRate: 1.5,
  muted: true
});

Remodal:

$('[data-remodal-id=modal]').remodal();
$(document).on('opening', '.remodal', function () {
  console.log('Modal is opening');
});

Summary

Vide is a specialized library for video backgrounds, offering simplicity and performance for video-related tasks. Remodal, on the other hand, is a more versatile modal solution with broader functionality. Vide excels in its focused approach but lacks the flexibility of Remodal for general modal needs. The code comparison shows Vide's straightforward video implementation versus Remodal's modal initialization and event handling. Choose Vide for video-specific projects and Remodal for general modal requirements.

A light-weight, customizable lightbox plugin for jQuery

Pros of Colorbox

  • More mature and widely adopted project with a larger user base
  • Extensive documentation and examples available
  • Supports a wider range of content types, including images, videos, and iframes

Cons of Colorbox

  • Larger file size and potentially heavier performance impact
  • Requires jQuery as a dependency
  • Less modern design and customization options out of the box

Code Comparison

Colorbox initialization:

$(document).ready(function(){
  $(".gallery").colorbox({rel:'gallery', transition:"fade"});
});

Remodal initialization:

$(document).ready(function(){
  $('[data-remodal-id=modal]').remodal();
});

Both libraries offer simple initialization, but Remodal's approach is more modern and flexible. Colorbox relies heavily on jQuery selectors, while Remodal uses data attributes for easier integration with various frameworks.

Colorbox provides more built-in options for content handling, especially for image galleries. Remodal, on the other hand, focuses on creating customizable modal windows with a cleaner, more minimalist approach.

Overall, Colorbox is better suited for projects requiring extensive media gallery functionality, while Remodal is ideal for creating simple, responsive modal dialogs with modern design sensibilities.

Light and responsive lightbox script with focus on performance.

Pros of Magnific-Popup

  • More feature-rich, with support for various content types (images, videos, iframes)
  • Better documentation and extensive customization options
  • Larger community and more frequent updates

Cons of Magnific-Popup

  • Larger file size, which may impact page load times
  • Steeper learning curve due to more complex configuration options
  • Requires jQuery, which may not be ideal for all projects

Code Comparison

Magnific-Popup initialization:

$('.image-link').magnificPopup({
  type: 'image',
  gallery: {
    enabled: true
  }
});

Remodal initialization:

$('[data-remodal-id=modal]').remodal();

Magnific-Popup offers more configuration options out of the box, while Remodal provides a simpler API for basic modal functionality. Magnific-Popup is better suited for complex media galleries, while Remodal is ideal for simple modal dialogs with minimal setup.

Featherlight is a very lightweight jQuery lightbox plugin. It's simple yet flexible and easy to use. Featherlight has minimal css and uses no inline styles, everything is name-spaced, it's completely customizable via config object and offers image, ajax and iframe support out of the box. Featherlights small footprint weights about 4kB – in total.

Pros of Featherlight

  • Lighter weight (2.6KB vs 4KB for Remodal)
  • More flexible content handling (images, AJAX, iframes)
  • Easier to customize and extend

Cons of Featherlight

  • Less built-in styling options
  • Fewer animation effects out of the box
  • Requires jQuery, while Remodal is framework-agnostic

Code Comparison

Featherlight:

$.featherlight('<h2>Hello</h2>');

Remodal:

var modal = $('[data-remodal-id=modal]');
modal.remodal().open();

Featherlight offers a more concise API for basic usage, while Remodal requires more setup but provides more control over modal instances.

Both libraries are lightweight and easy to use, but Featherlight excels in flexibility and extensibility, while Remodal offers more built-in styling options and animations. The choice between them depends on specific project requirements and personal preferences.

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

Pros of Fancybox

  • More feature-rich, offering various content types (images, videos, iframes)
  • Highly customizable with extensive API and options
  • Responsive design and touch-enabled for mobile devices

Cons of Fancybox

  • Larger file size due to more features, potentially impacting page load times
  • Steeper learning curve for advanced customizations
  • Requires jQuery, which may not be ideal for all projects

Code Comparison

Remodal (basic usage):

<div class="remodal" data-remodal-id="modal">
  <h1>Modal Content</h1>
  <button data-remodal-action="close">Close</button>
</div>

Fancybox (basic usage):

<a href="image.jpg" data-fancybox>
  <img src="thumbnail.jpg" alt="" />
</a>

Summary

Fancybox is a more comprehensive solution for creating lightboxes and modals, offering support for various content types and extensive customization options. However, this comes at the cost of a larger file size and potential complexity. Remodal, on the other hand, is a simpler, lightweight option focused specifically on modal dialogs, making it easier to implement for basic use cases but with fewer advanced features.

✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. πŸ‡ΊπŸ‡¦

Pros of SweetAlert2

  • More feature-rich with a wider variety of customization options
  • Actively maintained with frequent updates and bug fixes
  • Larger community and better documentation

Cons of SweetAlert2

  • Larger file size, which may impact page load times
  • Steeper learning curve due to more complex API
  • May be overkill for simple modal requirements

Code Comparison

Remodal:

$(document).on('opening', '.remodal', function () {
  console.log('Modal is opening');
});
$('[data-remodal-id=modal]').remodal();

SweetAlert2:

Swal.fire({
  title: 'Are you sure?',
  text: "You won't be able to revert this!",
  icon: 'warning',
  showCancelButton: true,
  confirmButtonText: 'Yes, delete it!'
}).then((result) => {
  if (result.isConfirmed) {
    // Handle confirmation
  }
});

SweetAlert2 offers more built-in functionality and a promise-based API, while Remodal focuses on simplicity and ease of use for basic modal requirements. SweetAlert2 is better suited for complex interactions, while Remodal may be preferable for straightforward modal implementations.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

NPM version Bower version Travis Remodal

No longer actively maintained. I am not interested to maintain jQuery plugins anymore. If you have some fixes, feel free to make PR.

Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.

logo

Notes

  • All modern browsers are supported.
  • IE8+. To enable IE8 styles add the lt-ie9 class to the html element, as modernizr does.
  • jQuery, jQuery2, Zepto support.
  • Browserify support.

Start

Download the latest version from GitHub or via package managers:

npm install remodal
bower install remodal

Include the CSS files from the dist folder in the head section:

<link rel="stylesheet" href="../dist/remodal.css">
<link rel="stylesheet" href="../dist/remodal-default-theme.css">

Include the JS file from the dist folder before the </body>:

<script src="../dist/remodal.min.js"></script>

You can define the background container for the modal(for effects like a blur). It can be any simple content wrapper:

<div class="remodal-bg">
...Page content...
</div>

And now create the modal dialog:

<div class="remodal" data-remodal-id="modal">
  <button data-remodal-action="close" class="remodal-close"></button>
  <h1>Remodal</h1>
  <p>
    Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
  </p>
  <br>
  <button data-remodal-action="cancel" class="remodal-cancel">Cancel</button>
  <button data-remodal-action="confirm" class="remodal-confirm">OK</button>
</div>

Don't use the id attribute, if you want to avoid the anchor jump, use data-remodal-id.

So, now you can call it with the hash:

<a href="#modal">Call the modal with data-remodal-id="modal"</a>

Or:

<a data-remodal-target="modal">Call the modal with data-remodal-id="modal"</a>

Options

You can pass additional options with the data-remodal-options attribute.

<div class="remodal" data-remodal-id="modal"
  data-remodal-options="hashTracking: false, closeOnOutsideClick: false">

  <button data-remodal-action="close" class="remodal-close"></button>
  <h1>Remodal</h1>
  <p>
    Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
  </p>
  <br>
  <button data-remodal-action="cancel" class="remodal-cancel">Cancel</button>
  <button data-remodal-action="confirm" class="remodal-confirm">OK</button>
</div>

hashTracking

Default: true

To open the modal without the hash, use the data-remodal-target attribute.

<a data-remodal-target="modal" href="#">Call the modal with data-remodal-id="modal"</a>

closeOnConfirm

Default: true

If true, closes the modal window after clicking the confirm button.

closeOnCancel

Default: true

If true, closes the modal window after clicking the cancel button.

closeOnEscape

Default: true

If true, closes the modal window after pressing the ESC key.

closeOnOutsideClick

Default: true

If true, closes the modal window by clicking anywhere on the page.

modifier

Default: ''

Modifier CSS classes for the modal that is added to the overlay, modal, background and wrapper (see CSS).

appendTo

Default: document.body

Globals

<script>
window.REMODAL_GLOBALS = {
  NAMESPACE: 'modal',
  DEFAULTS: {
    hashTracking: false
  }
};
</script>
<script src="../dist/remodal.js"></script>

NAMESPACE

Base HTML class for your modals. CSS theme should be updated to reflect this.

DEFAULTS

Extends the default settings.

Initialization with JavaScript

Do not set the 'remodal' class, if you prefer a JS initialization.

<div data-remodal-id="modal">
  <button data-remodal-action="close" class="remodal-close"></button>
  <h1>Remodal</h1>
  <p>
    Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
  </p>
</div>
<script>
    var options = {...};

    $('[data-remodal-id=modal]').remodal(options);
</script>

Methods

Get the instance of the modal and call a method:

var inst = $('[data-remodal-id=modal]').remodal();

/**
 * Opens the modal window
 */
inst.open();

/**
 * Closes the modal window
 */
inst.close();

/**
 * Returns a current state of the modal
 * @returns {'closed'|'closing'|'opened'|'opening'}
 */
inst.getState();

/**
 * Destroys the modal window
 */
inst.destroy();

Events

$(document).on('opening', '.remodal', function () {
  console.log('Modal is opening');
});

$(document).on('opened', '.remodal', function () {
  console.log('Modal is opened');
});

$(document).on('closing', '.remodal', function (e) {

  // Reason: 'confirmation', 'cancellation'
  console.log('Modal is closing' + (e.reason ? ', reason: ' + e.reason : ''));
});

$(document).on('closed', '.remodal', function (e) {

  // Reason: 'confirmation', 'cancellation'
  console.log('Modal is closed' + (e.reason ? ', reason: ' + e.reason : ''));
});

$(document).on('confirmation', '.remodal', function () {
  console.log('Confirmation button is clicked');
});

$(document).on('cancellation', '.remodal', function () {
  console.log('Cancel button is clicked');
});

CSS

Classes

.remodal Ҁ“ the default class of modal dialogs.

.remodal-wrapper Ҁ“ the additional wrapper for the .remodal, it is not the overlay and used for the alignment.

.remodal-overlay Ҁ“ the overlay of modal dialogs, it is under the wrapper.

.remodal-bg Ҁ“ the background of modal dialogs, it is under the overlay and usually it is the wrapper of your content. You should add it on your own.

The remodal prefix can be changed in the global settings. See the NAMESPACE option.

States

States are added to the .remodal, .remodal-overlay, .remodal-bg, .remodal-wrapper classes.

List:

.remodal-is-opening
.remodal-is-opened
.remodal-is-closing
.remodal-is-closed

Modifier

A modifier that is specified in the options is added to the .remodal, .remodal-overlay, .remodal-bg, .remodal-wrapper classes.

Using with other javascript libraries

Remodal has wrappers that make it easy to use with other javascript libraries:

Ember

License

The MIT License (MIT)

Copyright (c) 2015 Ilya Makarov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

NPM DownloadsLast 30 Days