Overview of vue-modal features
vue-modal is a lightweight (< 4kb gzipped), customizable, and stackable modal component for Vue.js 3. It follows WAI-ARIA Dialog (Modal) accessibility best practices, including keyboard focus trapping and support for the esc key to close. Key capabilities include:
- Control: Open/close via
v-modelor via anameprop withshow/hidefunctions. - Customization: Override title and content via slots; customize styling via CSS classes; use CSS animation classes for intro/outro effects.
- Behavior: Supports stackable modals, unclosable windows, and a 'live' mode to keep modals in the DOM. By default, modals are appended to the
<body>, but can be appended to a custom element. - Focus: Supports the
autofocusattribute on internal elements to set initial focus upon opening.