Modals
11/19/26About 1 min
Modals
Modal is a native <dialog>: Esc closes it, focus is trapped inside and returned on close. Dropdowns inside the modal open in the top layer, above the dialog — Esc in an open dropdown closes only the dropdown.
For modals driven by resources (create/edit forms, relation pickers) see Modals and relations.
Basic modal
<Btn color="primary" @click="open = true">Open modal</Btn>
<Modal modal-title="Example modal" :open="open" @close-modal="open = false">
<template #content>…</template>
<template #actions>
<Btn color="secondary" outline @click="open = false">Cancel</Btn>
<Btn color="primary" @click="save">Save</Btn>
</template>
</Modal>Confirm dialog
ModalService.showConfirm opens a ConfirmModal without any template code. It needs one <ModalWrapper /> mounted in your app (ShellComponent already includes it).
ModalService.showConfirm({
title: 'Delete record?',
message: 'This cannot be undone.',
confirmLabel: 'Delete',
onClose: ({ confirmed }) => confirmed && remove(),
});Use ModalService.openModal({ component, props: { ..., onClose } }) for your own modal components; they receive open and must emit closeModal.