vael-ui v0.5.7

Motion guide · 8 of 8

Server rendering

Motion works on server-rendered pages: entrances start before any script, and nothing plays twice when the page hydrates.

Before any script

On a server-rendered page, a v-animate entrance is written into the HTML as CSS, so it plays as the page paints, before your JavaScript loads, and never again on hydration. It covers opacity, x, y, scale, blur, on a spring or a duration, built-in entrances such as v-animate.rise included. Under reduced motion it only fades.

A staggered list

A number stagger reads each element's --i: set it from v-for's index, as in :style="{ '--i': index }". stagger: true spaces them by the stagger token.

What waits for JavaScript

Keyframe arrays, when: 'visible', layoutId, after, steps need the page's script, so those elements show as they are until it runs. An element named for a component (v-animate:rows) moves with its component. appear: 'later' counts the server render as the first render, so nothing there animates.

Open on load

An overlay that's open when the page loads renders open, without animating. A component's initial never plays on hydration, and a list's appear: true skips the items the server rendered. A component that's shown from its first render, such as a Message, shows as it is; it plays its entrance when it comes later.

Nuxt and Vite

The Nuxt module registers v-animate for you. With plain Vite SSR, set ssr: { noExternal: ['vael-ui'] } so each component's CSS comes along, and render the teleports into <body>, where overlays go. Both the VDOM and the Vapor builds render on the server and hydrate.