Vibary.ai
← Vibe Coding

Input Focus Underline

The label lifts out of the field and an underline grows outward from the center on focus.

formssubtleelegantinteraction · 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.

197 lines · react + motion only
import { useId, useState } from "react";
import { motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Input Focus Underline
 *
 * The label lifts out of the field and an underline draws outward from
 * the center the moment the input takes focus.

About this pattern

Focus feedback for text fields, sized for forms where a dozen of these fire while the user tabs through. The label travels up out of the input at a constant font size — a floating label that shrinks its glyphs is the cheapest tell in form design — and the accent line grows from the middle to both ends at once, which reads as the field opening rather than as a wipe the eye has to follow. A field that already holds a value keeps its label lifted after blur, so the state is never ambiguous.

Text field focusCheckout formSettings formInline edit field

Where it shows up

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

  • Add a supplierTwo fields now, the rest later
    Legal name
    Ridgeline Supply Co.
    Country
    Sweden
    VAT number
    SE556031820101
    Save supplier
    Form

    The floating-label idea, kept here without the glyph scaling.

Related patterns