Vibary.ai
← Vibe Coding

Inline Error Reveal

A field marks itself invalid: the error ring fades on and the message expands into place below.

feedbackcalmminimalinteraction · finite · intermediate · ~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.

262 lines · react + motion only
import { useId, useState, type FormEvent } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Inline Error Reveal
 *
 * A field that marks itself invalid: the error ring fades onto the
 * input while the message expands into place underneath.

About this pattern

Validation feedback that stays next to the thing that failed. On submit the field gains an error ring and the explanation expands underneath, pushing the rest of the form down by exactly its own height. Two decisions carry the pattern: the border 'changes color' by fading a ring over it rather than tweening the real border, which keeps the change on the compositor and lands on the exact error hue; and the height reveal is a short ease-out tween rather than a spring, because a spring would overshoot and drag the message text past its resting line. An error is bad news — it should appear calmly and be readable the instant it lands.

Form validationInvalid emailRequired fieldCheckout field error

Where it shows up

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

  • Payment
    Card number4242 4242 4242 4242Name on cardN. Bergström
    Expiry04 / 28CVC•••
    Subtotal$156.00Shipping$0.00Tax$13.65Total$169.65
    Pay $169.65
    Checkout

    Field-level validation: the input gains an error ring and the reason opens beneath it.

Related patterns