Vibary.ai
← Vibe Coding

Inline Edit Swap

A value becomes a field where it sits: the surface arrives around the words and the row never changes size.

formselegantminimalinteraction · finite · intermediate · ~0.2s
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.

430 lines · react + motion only
import {
  useEffect,
  useId,
  useRef,
  useState,
  type CSSProperties,
} from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

About this pattern

The failure mode of edit-in-place is the row growing when it opens, which shoves the rest of the settings list down and makes a small correction feel like a page change. So the reading state and the edit state are built from the same box, the same padding and the same type size, and the swap between them is opacity only — the field surface fades in around words that were already sitting exactly where the input will put them. The confirm controls take the same fixed slot the pencil occupied, so even the right edge holds still. The caret follows the swap in, escape cancels, enter commits, and focus lands back on the control that opened the row.

Settings row editProfile detail changeRename in placeRecord detail corrections

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

    Property values open for editing without the row moving.

Related patterns