Skip to main content

Vue animation example

Vue Page Transition: Slide and Fade Between Routes

Vue's <Transition> makes route animations possible; choosing the motion is the hard part. This example uses direction-aware slides: going to a later tab, the page exits left and the new one enters from the right, and going back reverses it. The bottom tab indicator slides along with the pages.

  • 4.5 KB file
  • 4 live inputs
  • Vue runtime
Live, try it

How this slide and fade route transition works

  • Direction comes from comparing the new tab index with the old one.
  • The outgoing page moves 30% of the width and fades; the incoming page moves the full distance, which reads as depth.
  • Tab changes fire "navigate" so you can keep vue-router in sync.

Add it to your Vue app

Install exodeui-vue, download the file below, and paste this. The code updates as you customize. Other runtimes are in the other tabs.

<script setup>
import { ExodeUICanvas } from 'exodeui-vue';

const onTrigger = (name) => {
  // fires: 'navigate'
};
</script>

<template>
  <ExodeUICanvas
    src="/vue-page-transition.exode"
    fit="Layout"
    @trigger="onTrigger"
    style="width: 100%; height: 720px"
  />
</template>

Inputs

InputTypeDefaultRange
tabsTextFeed,Search,Library,Profile—
accentText#42b883hex colour
inkText#1f2937hex colour
bgText#ffffffhex colour

Events: navigate

More Vue animations

The same idea in other frameworks: React shared element transition · Flutter hero product transition · JavaScript curtain wipe transition