Skip to main content
Vuetify0 v1.0 is here
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

Dialog

A headless modal dialog component using the native HTML dialog element.

Edit this page
Report a Bug
Open issues
View on GitHub
Copy Markdown

PreviewRenders elementIntermediateJul 19, 2026
Browser Support: Native Dialog
Chrome 37+ Edge 79+ Firefox 98+ Safari 15.4+ Opera 24+

Uses the native dialog element with showModal(). Safari 15.4+ is required; older versions have no support.

Usage

The Dialog component leverages the native showModal() API for proper modal behavior including focus trapping, backdrop rendering, and escape key handling. It provides v-model support for open/closed state management.

Deactivate account

This will permanently deactivate your account.

Are you sure you want to deactivate your account? All of your data will be permanently removed from our servers. This action cannot be undone.

Theme
Mode
Palettes
Accessibility
<script setup lang="ts">
  import { Dialog } from '@vuetify/v0'
</script>

<template>
  <div class="flex justify-center">
    <Dialog.Root>
      <Dialog.Activator class="px-4 py-2 bg-primary text-on-primary rounded-md text-sm font-medium">
        Click Me
      </Dialog.Activator>

      <Dialog.Content class="m-auto rounded-xl bg-surface border border-divider max-w-md w-full">
        <div class="px-4 py-2 border-b border-divider">
          <Dialog.Title as="h3" class="text-lg font-semibold text-on-surface">
            Deactivate account
          </Dialog.Title>

          <Dialog.Description class="text-sm text-on-surface-variant">
            This will permanently deactivate your account.
          </Dialog.Description>
        </div>

        <div class="p-4 space-y-4">
          <p class="text-sm text-on-surface leading-relaxed">
            Are you sure you want to deactivate your account? All of your data will
            be permanently removed from our servers. This action cannot be undone.
          </p>
        </div>

        <div class="flex gap-3 justify-end p-4 pt-0">
          <Dialog.Close class="px-4 py-2 text-sm font-medium rounded-md border border-divider hover:bg-surface-tint">
            Cancel
          </Dialog.Close>

          <Dialog.Close class="px-4 py-2 text-sm font-medium rounded-md bg-error text-on-error">
            Deactivate
          </Dialog.Close>
        </div>
      </Dialog.Content>
    </Dialog.Root>
  </div>
</template>

Anatomy

vue
<script setup lang="ts">
  import { Dialog } from '@vuetify/v0'
</script>

<template>
  <Dialog.Root>
    <Dialog.Activator />

    <Dialog.Content>
      <Dialog.Title />

      <Dialog.Description />

      <Dialog.Close />
    </Dialog.Content>
  </Dialog.Root>
</template>

Recipes

Click-Outside Dismissal

By default, clicking the backdrop closes the dialog. Set closeOnClickOutside to false on Dialog.Content to prevent this:

vue
<template>
  <Dialog.Content :close-on-click-outside="false">
    <!-- Dialog won't close on backdrop click -->
  </Dialog.Content>
</template>

Blocking Dialogs

The blocking prop disables scrim-based dismissal entirely — the dialog can only be closed programmatically. Use this for critical confirmations where the user must make an explicit choice:

vue
<template>
  <Dialog.Content blocking>
    <!-- No scrim, no click-outside close — must use Dialog.Close or v-model -->
  </Dialog.Content>
</template>

Accessibility

Dialog renders its panel through the native <dialog> element opened with showModal(), so focus trapping, backdrop rendering, inerting of the page behind it, and Escape-to-close all come from the browser.

ARIA Attributes

AttributeValueElement
aria-haspopupdialogActivator
aria-expandedtrue / falseActivator
roledialogContent
aria-modaltrueContent
aria-labelledbyTitle element IDContent
aria-describedbyDescription element IDContent
aria-labelLocalized “Close” stringClose

Dialog.Title and Dialog.Description generate the IDs referenced by aria-labelledby and aria-describedby. Render them inside Dialog.Content so the dialog has an accessible name and description.

Keyboard Navigation

KeyAction
Tab / Shift + TabCycles focus through focusable controls inside Content (trapped by showModal())
EscapeCloses the dialog (native cancel event)
Enter / SpaceActivates the focused control

Focus management

showModal() moves focus into the dialog on open, and the browser traps Tab within it while it stays open. Dialog.Activator renders a <button> by default — carrying aria-haspopup="dialog" and aria-expanded — and opens the dialog on click.

FAQ

Discord
Need help? Join our community for support and discussions ↗
Was this page helpful?

© 2016-1970 Vuetify, LLC
Services
Ctrl+/