Vibary.ai
← Vibe Coding

Modal Scale In

A dialog grows the last few percent into place behind a darkening scrim, and leaves the same way.

navigationpremiumelegantinteraction · finite · starter · ~0.3s
Interactive · click to play
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.

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

/**
 * Vibary · Modal Scale In
 *
 * A confirmation dialog that grows the last few percent into place behind
 * a darkening scrim, and leaves the same way it arrived. Escape or the

About this pattern

The confirmation step, given just enough presence to interrupt. The dialog starts a few percent under full size and settles at exactly 1.0 while the scrim darkens beneath it — that tiny travel is what makes it read as arriving in front of the page rather than being pasted onto it. Restraint is the whole craft here: a dialog is mostly text, and text that overshoots its final size is the cheapest-looking thing in interface motion, so the spring is damped well past the wobble threshold and the scale delta stays small enough that glyph rescaling is imperceptible. Dismissal is deliberately not the entrance reversed — a hair of shrink and a quick ease-out, because leaving is not worth watching.

Destructive confirmationSettings dialogInvite or share promptForm in an overlay

Where it shows up

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

  • Ridgeline
    Files
    Recent
    Shared
    Starred
    Trash
    FilesNew
    Brand refresh12 files
    Contracts6 files
    Photography48 files
    Q3 planning9 files
    Reports21 files
    Shared4 files
    Delete this project?Its 21 files and every share link stop working. This cannot be undone.
    CancelDelete
    Modal sheet

    The dialog scales up from just under full size as the page behind it dims.

Related patterns