Skip to main content
Vuetify0 is now in alpha!
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

Snackbar

Headless compound component for toast and snackbar notifications. Pairs with useNotifications for queue-driven stacks with auto-dismiss and pause on hover.

Usage

A single snackbar — render directly when you control the lifecycle yourself.

Anatomy

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

<template>
  <!-- Standalone -->
  <Snackbar.Portal>
    <Snackbar.Root>
      <Snackbar.Content />

      <Snackbar.Close />
    </Snackbar.Root>
  </Snackbar.Portal>

  <!-- Queue-driven -->
  <Snackbar.Portal>
    <Snackbar.Queue>
      <Snackbar.Root>
        <Snackbar.Content />

        <Snackbar.Close />
      </Snackbar.Root>
    </Snackbar.Queue>
  </Snackbar.Portal>
</template>

Examples

Notification queue

Snackbar.Queue connects to useNotifications and exposes queue items newest-first. Snackbar.Close auto-wires dismiss to the nearest Snackbar.Root — no @click needed.

Warning

Inside a Snackbar.Queue, clicking Snackbar.Close permanently removes the notification from both the queue and the registry. To remove from the toast surface while keeping the notification in the inbox, call ticket.dismiss() directly on the NotificationTicket.

Recipes

ARIA role

Set role directly on Snackbar.Root to control how screen readers announce the notification:

vue
<template>
  <!-- Polite — waits for user to be idle -->
  <Snackbar.Root role="status">
    <Snackbar.Content>Changes saved</Snackbar.Content>
    <Snackbar.Close />
  </Snackbar.Root>

  <!-- Assertive — interrupts immediately -->
  <Snackbar.Root role="alert">
    <Snackbar.Content>Build failed — check logs</Snackbar.Content>
    <Snackbar.Close />
  </Snackbar.Root>
</template>

Inline rendering

Pass :teleport="false" to render the portal inline instead of teleporting to <body>. Useful in docs, Storybook, or scoped container layouts:

vue
<template>
  <div class="relative h-48">
    <Snackbar.Portal :teleport="false" class="absolute bottom-4 right-4">
      <Snackbar.Root>
        <Snackbar.Content>Changes saved</Snackbar.Content>
        <Snackbar.Close />
      </Snackbar.Root>
    </Snackbar.Portal>
  </div>
</template>

Accessibility

ConcernImplementation
Live regionSnackbar.Root defaults to role="status". Override with role="alert" for urgent notifications. No aria-live on Portal to avoid nesting conflicts.
role="status"Implicit aria-live="polite" — screen reader waits for idle. Use for confirmations and info.
role="alert"Implicit aria-live="assertive" — screen reader interrupts. Use for errors and warnings.
Close buttonaria-label="Close" hardcoded on Snackbar.Close.
TimingAuto-dismiss pauses on hover and focus (WCAG 2.2.1). Tabbing into a snackbar pauses the queue; focus leaving the container resumes it.
FocusNo focus trap — snackbars are non-modal.

API Reference

The following API details are for all variations of the Snackbar component.

Snackbar.Root

Props

namespace

string | undefined

Namespace for dependency injection.

Default: "v0:notifications"

id

any

Unique identifier. Auto-generated if not provided.

Default: useId()

Events

dismiss

[id: ID]

Slots

default

SnackbarRootSlotProps

Snackbar.Close

Props

namespace

string | undefined

Namespace for dependency injection.

Default: "v0:notifications"

Slots

default

SnackbarCloseSlotProps

Snackbar.Portal

Props

teleport

string | false | undefined

Teleport target. `false` renders inline.

Default: "body"

Slots

default

SnackbarPortalSlotProps

Snackbar.Queue

Props

namespace

string | undefined

Which notifications instance to connect to.

Default: "v0:notifications"

Slots

default

SnackbarQueueSlotProps
Was this page helpful?

Ctrl+/