Sets an element to a modal state using makeup-keyboard-trap and makeup-screenreader-trap. All other elements become "inert".
This module is still in an experimental state, until it reaches v1 you must consider all minor releases as breaking changes.
import * as modal from "makeup-modal";
// set an element to modal
modal.modal(document.querySelector("el"));
// reset the element to non-modal
modal.unmodal();
npm install makeup-modal
useHiddenProperty
: usehidden
property for inert content instead ofaria-hidden
(useful for fullscreen modals) (default: false)hoist
: moves the element to the document root (default: false)wrap
: if element is at document root, wraps all "inert" sibling elements into a single container (default: false)
- makeup-modal
- makeup-unmodal