Transitions

Smooth animations help make a UI feel great. Using Vue’s transition system and re-usable functional components, you can easily control the motion of your application. Most components can have their transition altered through the transition prop.

Usage

Vuetify comes with over 10 custom css animations that can be applied to numerous components or your own custom use-case

transitions/usage.vue

API

Examples

Props

Custom Origin

Programmatically control the transition origin with a simple prop.

transitions/prop-custom-origin.vue

Misc

Expand x

The expand transition is used in Expansion Panels and List Groups. There is also a horizontal version available with v-expand-x-transition.

transitions/misc-expand-x.vue

Fab

An example of the fab transition can be found in the v-speed-dial component.

transitions/misc-fab.vue

Fade

An example of the fade transition can be found on the Carousel component.

transitions/misc-fade.vue

Scale

Many of Vuetify’s components contain a transition prop which allows you to specify your own.

transitions/misc-scale.vue

Scroll x

Scroll X transitions continue along the horizontal axis.

transitions/misc-scroll-x.vue

Scroll y

Scroll Y transitions continue along the vertical axis.

transitions/misc-scroll-y.vue

Slide x

Slide x transitions move along the horizontal axis.

transitions/misc-slide-x.vue

Slide y

Animations use the application’s $primary-transition.

transitions/misc-slide-y.vue

Todo list

Using multiple custom transitions, it is easy to bring a simple todo list to life!

transitions/misc-todo.vue

Create your own

You can use Vuetify’s transition helper function to easily create your own custom transitions. This function will return an object that you can import into Vue. Using Vue’s functional component option will make sure your transition is as efficient as possible. Simply import the function:

import { createSimpleTransition } from 'vuetify/components/transitions/createTransition'

const myTransition = createSimpleTransition('my-transition')

Vue.component('my-transition', myTransition)

The createSimpleTransition function accepts 1 argument, name. This will be the name that you can hook into with your style. This is an example of what v-fade-transition looks like:

.fade-transition
  &-leave-active
    position: absolute

  &-enter-active, &-leave, &-leave-to
    transition: $primary-transition

  &-enter, &-leave-to
    opacity: 0

Ready for more?

Continue your learning with related content selected by the Team or move between pages by using the navigation links below.