Animated Input

Open in v0
~0.9 kB

Last updated: September 20, 2026

React text input with smooth focus animations, floating labels, and visual feedback. Modern form input component with Motion transitions for better UX.

Installation

npx smoothui-cli add animated-input

Features

Smooth focus animations with floating labels and optional leading icons.

Variants

Focus an input in the panel to see the label animation for each field type.

Email

Email field with a mail icon — the default contact-form input.

Password

Password field with a lock icon — the label floats above on focus like the others.

Username

Username field with a user icon — good for registration flows.

Accessibility

ARIA Attributes

AttributeElementPurpose
aria-labelInputProvides an accessible name matching the label text
aria-hidden="true"Icon containerHides the decorative icon from screen readers

Screen Reader

  • The floating label is programmatically associated with the input via htmlFor and id
  • The aria-label attribute provides an accessible name for assistive technologies

Reduced Motion

This component respects the prefers-reduced-motion media query via useReducedMotion from Motion. When reduced motion is preferred, the floating label transitions are applied instantly without animation.

Props

Created by

Improved by

Eduardo Calvo's avatar

Powered by

motion.dev
lucide.dev

© 2026 SmoothUI. Built by Eduardo Calvo.