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

Presence

Animation-agnostic mount lifecycle for conditional content.

Usage

v-if removes elements from the DOM immediately — there’s no way to animate them out. Vue’s <Transition> solves this for CSS transitions, but it’s opinionated about how animation works and doesn’t compose well with headless components.

Presence fills this gap. It keeps content in the DOM during an exit phase, exposes a done() callback you call when your animation finishes, then removes the content. It doesn’t care how you animate — CSS keyframes, Web Animations API, GSAP, or nothing at all.

Anatomy

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

<template>
  <Presence />
</template>

Architecture

Presence wraps the usePresence composable, which implements a four-state machine:

Statedata-stateIn DOM?Purpose
unmountedNoContent removed
mountedmountedYesJust entered DOM — target for enter animations
presentpresentYesActive and visible
leavingleavingYesExit animation running, waiting for done()

The mounted state lasts one tick, giving the browser a frame to apply initial styles before transitioning to present. This is the same principle behind requestAnimationFrame-based enter animations.

Examples

Accessibility

Presence is transparent — it adds no DOM elements, ARIA attributes, or keyboard behavior. Accessibility is the responsibility of the content you render inside.

Tip

Ensure animated content respects prefers-reduced-motion. Presence doesn’t enforce motion preferences — your CSS should handle @media (prefers-reduced-motion: reduce).

FAQ

API Reference

The following API details are for all variations of the Presence component.
Was this page helpful?

Ctrl+/