Components

Modal

Show dialogs and confirmations with UiModal and UiConfirmModal.

UiModal presents content in an overlay; UiConfirmModal adds confirm / cancel actions. Open and close them through their exposed handle (showDialog / closeDialog).

Open a modal

<script setup lang="ts">
import { ref } from 'vue'

const modal = ref()
</script>

<template>
  <UiButton variant="filled" text="Open" @click="modal.showDialog()" />

  <UiModal ref="modal" title="Profile" size="md">
    <template #body>
      <p>Modal content…</p>
    </template>
  </UiModal>
</template>

Pick a mode and size

<template>
  <UiModal ref="sheet" mode="side-sheet" size="lg" title="Filters" />
</template>

Confirm a destructive action

<script setup lang="ts">
import { ref } from 'vue'

const confirm = ref()

function remove() {
  // delete, then close
  confirm.value.closeDialog()
}
</script>

<template>
  <UiConfirmModal
    ref="confirm"
    variant="danger"
    title="Delete item?"
    message="This can't be undone."
    confirm-label="Delete"
    cancel-label="Cancel"
    @confirm="remove"
  />
</template>

UiModal props

PropTypeDefaultDescription
mode'modal' | 'side-sheet' | 'headless'Dialog shape (preferred over legacy flags).
size'sm' | 'md' | 'lg' | 'fullscreen'Dialog size.
titlestring | nullHeader title.
messagestring | nullBody message.
variant'danger' | 'warning' | 'success' | 'primary''danger'Visual intent.
closeOnClickOutsidebooleantrueDismiss when clicking the backdrop.
showAsModalboolean | nulltrueLegacy modal toggle.
customClass / bodyDialogClassstring | string[] | Record<string, boolean> | nullExtra classes.

Exposed: showDialog(), closeDialog(). Emits: onCloseDialog.

UiConfirmModal

Extends UiModal with:

PropTypeDefaultDescription
confirmLabelstring | null'Delete'Confirm button label.
cancelLabelstring'Cancel'Cancel button label.
isLoadingbooleanfalseLoading state on the confirm button.
loadingLabelstring'Deleting...'Text while loading.

Emits: confirm, onCloseDialog.

Copyright © 2026