Vibary.ai
← Vibe Coding

Page Transition Fade

The outgoing view sinks a few pixels as it fades while the incoming one rises to meet it.

loadingelegantpremiumautomatic · finite · starter · ~0.4s
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

239 lines · react + motion only
import { useEffect, useState } from "react";
import type { ReactNode } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Page Transition Fade
 *
 * A route change with a direction: the outgoing view drops a few pixels

About this pattern

A route change with a direction. The leaving view drops three to nine pixels as its opacity goes, the arriving view starts the same distance below its resting place and lifts into it, and the two overlap rather than taking turns — a fade-out-then-fade-in leaves an empty frame in the middle, which is the moment that makes an app feel slow. Both views live in one grid cell, so the frame is sized by the taller of them while they cross and can never collapse and shove the rest of the page. Travel is single-digit pixels on a spring above critical damping: chrome should be felt, not watched.

Route changeDashboard section swapSettings pane changeDocumentation page navigation

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • Ridgeline
    Docs
    Recent
    Shared
    Templates
    Trash
    DocsNew
    Q3 planning notesEdited 14 minutes agoScope
    Document page

    Opening a different page settles the body content in without a blank frame between.

Related patterns