A modern, accessible modal system with rich animations and features
View on GitHubMultiple built-in animations with smooth transitions
ARIA support and keyboard navigation
Modal state preserved in URL hash
Works great on all devices
// Basic initialization
const modal = new Modaling({
id: 'my-modal',
animation: 'zoom',
size: 'md',
closeOnOverlay: true,
closeOnEscape: true
});
// Show the modal
modal.show();
// Hide the modal
modal.hide();
// Data attributes usage
<button
data-modal-target="my-modal"
data-modal-animation="zoom"
data-modal-size="lg"
>
Open Modal
</button>
This is a basic modal example with default settings.
This modal uses the zoom animation effect.
This is a large-sized modal example.
Beep beep! Watch this cool animation.
This modal flips into view!
Open sesame!
Watch this modal unfold smoothly.
Round and round we go!