Resources
Changelog
Version history for @kolirt/vue-modal.
Changelog
Full history is on GitHub. This page summarises notable changes by release.
v2.3.0
Added
- Global lifecycle events
onModalOpen/onModalClose— subscribe to modal open/close events globally or scoped to a single group, with overloads(handler)and(group, handler). Handlers receive theModalItemand run synchronously —onModalOpenfires right after the modal is pushed to state,onModalClosefires after the modal is finalized and removed (before theopenModalpromise settles). Both return an unsubscribe function. Useful for cross-group coordination (e.g. closing every'sidebar'modal whenever something opens in'main'), analytics, focus restoration. Thrown errors inside handlers are caught and logged so a faulty subscriber can't break the open/close flow. See Global events.
v2.2.1
Fixed
disableCloseOnInteractOutsidenow correctly suppresses true outside clicks — clicks landing outside the entire<ModalTarget>region (e.g. on the host site's header when the region is positioned below it) used to close the modal regardless of this flag, because reka-ui'spointer-down-outsidehandler treated them as overlay interactions.<ModalRoot>now scopes its overlay-close path to clicks whose target lies inside the region; outside-region clicks are handled exclusively by thedisableCloseOnInteractOutsidegesture. The two flags are now fully independent.
v2.2.0
Added
<ModalOverlay>default slot — overlay now exposes a default slot so you can place decorative elements (blur layers, gradients, noise textures, branding watermarks, animated backgrounds) on top of the dimming layer. The overlay keepspointer-events: noneby default; setpointer-events: autoon slotted elements that need to receive interaction.
v2.1.0
Added
useModal().isTop— reactiveComputedRef<boolean>, true only when the controller's instance is the topmost modal in the global stack. ComplementsisOpen, which stays true while the instance is mounted regardless of stack position.
v2.0.0
Added
- Modal groups — every modal belongs to a named group; groups are registered via
declare module '@kolirt/vue-modal' { interface ModalGroupRegistry { … } }for compile-time safety. <ModalRoot>/<ModalContent>/<ModalTitle>/<ModalDescription>/<ModalOverlay>— headless component primitives replacing the v1BaseModalscoped-slot pattern.useModalContext()— composable forconfirm(data),close(),onBeforeClose(guard),isTopmost,effectiveOptionsinside a modal component.useModal()— composable that binds a controller (open / close / isOpen / on / off) to a component with auto-cleanup on scope dispose.replaceModal()— replaces the topmost modal in a group with a new one (instant exit, then open).closeAllModals()/closeModalsByGroup()/closeModalById()— close helpers with optionalignoreGuardandinstantExitflags (closeModalByIdalso acceptssuccess/data).beforeCloseguards — returnfalsefrom a guard registered withonBeforeClose()to veto a close attempt.instantEnter/instantExitoptions — skip enter or exit animations for programmatic flows.ModalHandle.on/.off— subscribe to events emitted by the modal component afteropenModalreturns.modals/isOpened/groupModals()/isGroupOpen()— reactive state exports for reading the current stack.ModalGroupRegistryTypeScript augmentation — all group strings are checked at compile time.- reka-ui integration —
<ModalRoot>delegates to<DialogRoot>for ARIA, focus trap, and Escape handling. - Scroll lock with layout-shift compensation —
useScrollLocksetsbody.overflowand adds compensatingbody.paddingRightequal to the scrollbar width.
Changed
openModal(Component, props, options?)→openModal(Component, options?)— props moved insideoptions.props.- Plugin registration:
createModal(Options)animation/style options removed; replaced withcreateModal({ groups: ModalGroupsConfig }). ModalTargetgroup prop is now required and type-checked.- Source moved from
lib/topackages/core/src/.
Removed
confirmModal()global function (useuseModalContext().confirm()from inside a modal, orcloseModalById(id, { success: true, data })from outside).$on/$off/$emitevent bus andEventsenum.SimpleModalbuilt-in layout component.useLockscroll-lock composable (scroll lock is now automatic per target).BaseModalinternal component.- Animation / style options (
transitionTime,animationType,modalStyle,overlayStyle).
v1.x (on master branch)
See GitHub releases for the v1 history. Notable v1 milestones:
- v1.2 —
backdrop-filteroverlay option,forceoption onopenModalto close all before opening. - v1.1 — multiple group support,
withoutOverlayprop onModalTarget. - v1.0 — initial release: imperative
openModal, global event bus,SimpleModallayout,useLockscroll lock.
