Skip to content

Modal

An accessible modal dialog using the native <dialog> element with focus trap, closing animation, and backdrop blur.

click to open
Open Modal

Confirm action

Are you sure you want to delete this item? This action cannot be undone.
sm · lg · xl
SmallLargeXL

Small modal

Compact dialog for quick confirmations.

Large modal

More space for forms and longer content.

XL modal

Full-width content area for complex layouts.
const modal = document.querySelector('ac-modal');
modal.show();
modal.close();
modal.toggle();
  • Native <dialog> — browsers handle scroll lock and backdrop automatically
  • Focus trap: Tab / Shift+Tab stays inside the modal
  • Escape closes the modal
  • role="dialog" + aria-modal="true" + aria-labelledby auto-wired to .ac-modal__title
AttributeValuesDescription
openbooleanShows the modal
sizesm | md | lg | xl | fullDialog width
scrollablebooleanSticky header/footer, scrollable body
labelstringOverrides aria-label