Animated OTP Input

One-time-password input with focus and reveal animations.

Open in v0~8.9 kB

Last updated: March 7, 2026

Verify Your Code
Enter the 6-digit code sent to your device

Installation

npx smoothui-cli add animated-o-t-p-input

Features

  • Auto-advance and backspace support
  • Animated focus and validation
  • Masking options
  • Accessible and mobile-friendly

Accessibility

Keyboard Interactions

KeyDescription
0-9Enters a digit and auto-advances to the next slot
BackspaceDeletes the current digit and moves focus to the previous slot
TabMoves focus to/from the OTP input

ARIA Attributes

AttributeElementPurpose
aria-labelOTP inputProvides an accessible name (defaults to "One-time password input")
aria-describedbyOTP inputReferences an optional description element for additional context

Reduced Motion

This component respects the prefers-reduced-motion media query via useReducedMotion from Motion. When reduced motion is preferred, slot entrance animations, digit flip transitions, and the blinking caret are all disabled.

Props

On this page

Created by

Powered by

motion.dev
lucide.dev
input-otp.rodz.dev