A host at the root
UIApp
renders the content of its snippet and the modal stack of the manager. It does not create an extra visual container. Use it once around the outlet.
<!-- app/app.meeko -->
<template>
<UIApp>
<MeekoOutlet />
</UIApp>
</template>Contract
It has no public props or events. It requires the
default
snippet. The plugin registered by
@meekojs/ui
provides the context; you do not need to create your own plugin or call
provideModal.
useModal()
opens components whose name starts with
Modal, with the props of your application's component registry.
useModalInstance()
closes the current instance with a result or dismisses it.
const modal = useModal()
// Call this function from a user action.
async function confirm() {
const accepted = await modal.open<boolean>('ModalConfirm', {
message: 'Do you want to confirm this action?',
})
// boolean | undefined: dismissing returns undefined.
return accepted
}See the Modal guide for the confirmation component, the sizes and the protected closes.