Premium OTP Input
A highly polished, production-ready OTP Verification Input Component with premium micro-interactions, smooth morphing animations, and complete configurability.
uiNew Releaseframer-motionlucide-react
Installation
$npx futureuikit add otp-input
Import
import { OtpInput } from "@/components/ui/otp-input"
Layout Variant
Color Theme
Spacing
Named Keys & Props
Pass these exact named keys as props on <OtpInput />. Click any color pill to copy the prop.
colorDefault is "default"(Black & White)themeSurface theme"light""dark"shapeCorner shape"default""square""rounded""sharp"spacingInner spacing"default""2x""4x""6x""8x"Usage Example
A basic implementation example to get you started.
Example Implementation
import { OtpInput } from "@/components/ui/otp-input";
export default function Example() {
return (
<OtpInput
length={6}
onVerify={async (otp) => {
// Simulate API call
await new Promise(resolve => setTimeout(resolve, 2000));
return otp === "123456";
}}
/>
);
}Features
Key capabilities and highlights.
Key Capabilities
- ◆Dynamic OTP length (4-10 digits).
- ◆Premium SaaS-quality design with smooth border transitions and focus glow.
- ◆Intelligent keyboard navigation and paste support.
- ◆Advanced success animation: Inputs merge and morph into a circular success badge with particle burst.
- ◆Advanced failure animation: Shake effect followed by morphing into an error badge.
- ◆Fully responsive and supports both light and dark themes.
Notes
Important implementation details to consider.
Implementation Details
- ◆Install: Run 'npx futureuikit add otp-input'.
- ◆Import: 'import { OtpInput } from "@/components/ui/otp-input";'
- ◆Props: Configure 'length' (4-10) and 'onVerify' (async function returning boolean).
- ◆States: The component handles Loading, Success, and Error animations automatically based on the 'onVerify' result.