Vue Final Modal is a highly optimized and lightweight modal library specifically designed for Vue 3 applications, providing robust dialog, popup, and overlay functionalities. The current stable version is 4.5.5, with an active beta development for version 5.0.0, indicating a consistent release cadence with a focus on ongoing improvements and new features. Key differentiators include its balance of power and lightweight footprint, extensive customization options, and strong TypeScript support, making it suitable for complex UIs while maintaining performance. It handles common modal concerns like accessibility, scroll locking, and stacking contexts effectively, providing a comprehensive solution for interactive overlays in Vue 3 projects.
npm install vue-final-modalVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates two ways to use Vue Final Modal: declarative with v-model and programmatically using the `useModal` composable. It shows basic modal opening/closing and integrates the `ModalsContainer` for programmatic modals.
Refer to the official migration guide from v3 to v4: https://v4.vue-final-modal.org/get-started/migration/from-v3
Review your `scroll-lock` related configurations if you directly interacted with `body-scroll-lock` in previous versions. Check the v5 beta release notes for details.
Add `<ModalsContainer />` to your `App.vue` or a main layout component.
Test modal interactions thoroughly with keyboard navigation and screen readers. Add appropriate ARIA roles and labels to custom modal content and controls.
Verify that `overlay-transition` and `content-transition` props correctly map to your CSS transition classes. Use browser developer tools to inspect applied classes during modal transitions.
Change your import statement to `import { VueFinalModal } from 'vue-final-modal'`.Add `<ModalsContainer />` to your root `App.vue` or parent layout component where programmatic modals should render.
Access properties like `modalId` from the modal instance returned by `open()` or ensure correct type inference for dynamically created modals, especially if you're passing custom props.