---
title: "Enter and leave with Transition · vuejs.school"
description: "Fade and slide an element in and out with the classes <Transition> adds, swap one element for another with a key and mode=\"out-in\", and tone the motion down for people who ask for less."
canonical_url: "https://vuejs.school/learn/animation/enter-and-leave-with-transition"
meta:
  "og:description": "Fade and slide an element in and out with the classes <Transition> adds, swap one element for another with a key and mode=\"out-in\", and tone the motion down for people who ask for less."
  "og:image": "https://vuejs.school/_og/d/a_~RW50ZXIgYW5kIGxlYXZlIHdpdGggVHJhbnNpdGlvbiDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Enter%2Band%2Bleave%2Bwith%2BTransition%2Cdescription_~RmFkZSBhbmQgc2xpZGUgYW4gZWxlbWVudCBpbiBhbmQgb3V0IHdpdGggdGhlIGNsYXNzZXMgPFRyYW5zaXRpb24-IGFkZHMsIHN3YXAgb25lIGVsZW1lbnQgZm9yIGFub3RoZXIgd2l0aCBhIGtleSBhbmQgbW9kZT0ib3V0LWluIiwgYW5kIHRvbmUgdGhlIG1vdGlvbiBkb3duIGZvciBwZW9wbGUgd2hvIGFzayBmb3IgbGVzcy4%2Ceyebrow_~QW5pbWF0aW9uIMK3IExlc3NvbiAxIG9mIDQ%2Ctint_sand%2Cp_Ii9sZWFybi9hbmltYXRpb24vZW50ZXItYW5kLWxlYXZlLXdpdGgtdHJhbnNpdGlvbiI%2Cs_UgkhX6USG7oIatHB.png"
  "og:image:alt": "Enter and leave with Transition · vuejs.school"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Enter and leave with Transition · vuejs.school"
  "twitter:image": "https://vuejs.school/_og/d/a_~RW50ZXIgYW5kIGxlYXZlIHdpdGggVHJhbnNpdGlvbiDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Enter%2Band%2Bleave%2Bwith%2BTransition%2Cdescription_~RmFkZSBhbmQgc2xpZGUgYW4gZWxlbWVudCBpbiBhbmQgb3V0IHdpdGggdGhlIGNsYXNzZXMgPFRyYW5zaXRpb24-IGFkZHMsIHN3YXAgb25lIGVsZW1lbnQgZm9yIGFub3RoZXIgd2l0aCBhIGtleSBhbmQgbW9kZT0ib3V0LWluIiwgYW5kIHRvbmUgdGhlIG1vdGlvbiBkb3duIGZvciBwZW9wbGUgd2hvIGFzayBmb3IgbGVzcy4%2Ceyebrow_~QW5pbWF0aW9uIMK3IExlc3NvbiAxIG9mIDQ%2Ctint_sand%2Cp_Ii9sZWFybi9hbmltYXRpb24vZW50ZXItYW5kLWxlYXZlLXdpdGgtdHJhbnNpdGlvbiI%2Cs_UgkhX6USG7oIatHB.png"
  "twitter:image:alt": "Enter and leave with Transition · vuejs.school"
---

> Index of every page on this site: [llms.txt](https://vuejs.school/llms.txt)

# **Enter and leave with Transition**

Fade and slide an element in and out with the classes \<Transition> adds, swap one element for another with a key and mode="out-in", and tone the motion down for people who ask for less.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://vuejs.school/#website","@type":"WebSite","description":"A free AI-instructed school for Vue.js. Short tutorials, runnable code and quizzes that adapt to you.","name":"vuejs.school","url":"https://vuejs.school/","publisher":{"@id":"https://vuejs.school/#identity"}},{"@id":"https://vuejs.school/learn/animation/enter-and-leave-with-transition#webpage","@type":"WebPage","description":"Fade and slide an element in and out with the classes \u003CTransition> adds, swap one element for another with a key and mode=\"out-in\", and tone the motion down for people who ask for less.","name":"Enter and leave with Transition","url":"https://vuejs.school/learn/animation/enter-and-leave-with-transition","breadcrumb":{"@id":"https://vuejs.school/learn/animation/enter-and-leave-with-transition#breadcrumb"},"isPartOf":{"@id":"https://vuejs.school/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://vuejs.school/learn/animation/enter-and-leave-with-transition"]}],"primaryImageOfPage":{"@id":"https://vuejs.school/#logo"}},{"@id":"https://vuejs.school/#identity","@type":"Organization","description":"A free AI-instructed school for Vue.js. Short tutorials, runnable code and quizzes that adapt to you.","name":"vuejs.school","url":"https://vuejs.school","logo":{"@id":"https://vuejs.school/#logo"}},{"@id":"https://vuejs.school/learn/animation/enter-and-leave-with-transition#article","description":"Fade and slide an element in and out with the classes \u003CTransition> adds, swap one element for another with a key and mode=\"out-in\", and tone the motion down for people who ask for less.","headline":"Enter and leave with Transition","inLanguage":"en","isAccessibleForFree":true,"thumbnailUrl":"https://vuejs.school/_og/d/a_~RW50ZXIgYW5kIGxlYXZlIHdpdGggVHJhbnNpdGlvbiDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Enter%2Band%2Bleave%2Bwith%2BTransition%2Cdescription_~RmFkZSBhbmQgc2xpZGUgYW4gZWxlbWVudCBpbiBhbmQgb3V0IHdpdGggdGhlIGNsYXNzZXMgPFRyYW5zaXRpb24-IGFkZHMsIHN3YXAgb25lIGVsZW1lbnQgZm9yIGFub3RoZXIgd2l0aCBhIGtleSBhbmQgbW9kZT0ib3V0LWluIiwgYW5kIHRvbmUgdGhlIG1vdGlvbiBkb3duIGZvciBwZW9wbGUgd2hvIGFzayBmb3IgbGVzcy4%2Ceyebrow_~QW5pbWF0aW9uIMK3IExlc3NvbiAxIG9mIDQ%2Ctint_sand%2Cp_Ii9sZWFybi9hbmltYXRpb24vZW50ZXItYW5kLWxlYXZlLXdpdGgtdHJhbnNpdGlvbiI%2Cs_UgkhX6USG7oIatHB.png","@type":["Article","TechArticle"],"articleSection":["Animation"],"author":{"@id":"https://vuejs.school/#identity"},"image":{"@id":"https://vuejs.school/#/schema/image/1"},"isPartOf":{"@id":"https://vuejs.school/learn/animation/enter-and-leave-with-transition#webpage"},"keywords":["\u003CTransition>","v-enter-from / v-leave-to","mode=\"out-in\"","prefers-reduced-motion","JavaScript hooks"],"mainEntityOfPage":{"@id":"https://vuejs.school/learn/animation/enter-and-leave-with-transition#webpage"},"publisher":{"@id":"https://vuejs.school/#identity"}},{"@id":"https://vuejs.school/learn/animation/enter-and-leave-with-transition#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Skill tree","item":"https://vuejs.school/track","position":1},{"@type":"ListItem","name":"Animation","item":"https://vuejs.school/track/animation","position":2},{"@type":"ListItem","name":"Enter and leave with Transition","position":3}]},{"@id":"https://vuejs.school/#logo","@type":"ImageObject","caption":"vuejs.school","contentUrl":"https://vuejs.school/apple-touch-icon.png","inLanguage":"en","url":"https://vuejs.school/apple-touch-icon.png"},{"@id":"https://vuejs.school/#/schema/image/1","@type":"ImageObject","contentUrl":"https://vuejs.school/_og/d/a_~RW50ZXIgYW5kIGxlYXZlIHdpdGggVHJhbnNpdGlvbiDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Enter%2Band%2Bleave%2Bwith%2BTransition%2Cdescription_~RmFkZSBhbmQgc2xpZGUgYW4gZWxlbWVudCBpbiBhbmQgb3V0IHdpdGggdGhlIGNsYXNzZXMgPFRyYW5zaXRpb24-IGFkZHMsIHN3YXAgb25lIGVsZW1lbnQgZm9yIGFub3RoZXIgd2l0aCBhIGtleSBhbmQgbW9kZT0ib3V0LWluIiwgYW5kIHRvbmUgdGhlIG1vdGlvbiBkb3duIGZvciBwZW9wbGUgd2hvIGFzayBmb3IgbGVzcy4%2Ceyebrow_~QW5pbWF0aW9uIMK3IExlc3NvbiAxIG9mIDQ%2Ctint_sand%2Cp_Ii9sZWFybi9hbmltYXRpb24vZW50ZXItYW5kLWxlYXZlLXdpdGgtdHJhbnNpdGlvbiI%2Cs_UgkhX6USG7oIatHB.png","inLanguage":"en","url":"https://vuejs.school/_og/d/a_~RW50ZXIgYW5kIGxlYXZlIHdpdGggVHJhbnNpdGlvbiDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Enter%2Band%2Bleave%2Bwith%2BTransition%2Cdescription_~RmFkZSBhbmQgc2xpZGUgYW4gZWxlbWVudCBpbiBhbmQgb3V0IHdpdGggdGhlIGNsYXNzZXMgPFRyYW5zaXRpb24-IGFkZHMsIHN3YXAgb25lIGVsZW1lbnQgZm9yIGFub3RoZXIgd2l0aCBhIGtleSBhbmQgbW9kZT0ib3V0LWluIiwgYW5kIHRvbmUgdGhlIG1vdGlvbiBkb3duIGZvciBwZW9wbGUgd2hvIGFzayBmb3IgbGVzcy4%2Ceyebrow_~QW5pbWF0aW9uIMK3IExlc3NvbiAxIG9mIDQ%2Ctint_sand%2Cp_Ii9sZWFybi9hbmltYXRpb24vZW50ZXItYW5kLWxlYXZlLXdpdGgtdHJhbnNpdGlvbiI%2Cs_UgkhX6USG7oIatHB.png"}]}
```