Vibary.ai
← Vibe Coding

Optimistic Row Insert

The new entry lands at half opacity the instant it is asked for, then firms up when the server agrees.

loadingfriendlyminimalinteraction · finite · intermediate · ~1.1s
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.

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

/**
 * Vibary · Optimistic Row Insert
 *
 * The row lands the instant it is asked for, at reduced opacity and with
 * a hollow marker, and firms up when the server agrees. Nothing waits on

About this pattern

The alternative to a disabled button and a wait. On submit the entry is in the list on the same tick, at reduced opacity with a hollow marker — legible, but visibly provisional — and the neighbours reflow around it on a spring that settles once. When the write is acknowledged the opacity firms to full and the marker fills; that single value is the whole difference between asked-for and real, which is what makes a rejection easy to reverse. The status word crossfades inside a reserved box so the entry never changes width, and no part of the sequence blocks anything else on the page.

Add to a listCreate a recordInvite a teammateComment submit

Where it shows up

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

  • Ridgeline
    Issues
    Backlog
    Active
    Cycles
    Views
    IssuesNew
    Colourway picker drops a frameRID-412 · PriyaIn progress
    Receipt totals misalign on narrowRID-408 · MarcusTodo
    Session expires without warningRID-401 · DanaIn review
    Export queue stalls past 500 rowsRID-397 · NilsTodo
    Search ranks archived firstRID-390 · PriyaDone
    Issue tracker

    A new row appears in the list the moment you submit, before the server has confirmed it.

Related patterns