Uilora
ComponentsBlogMCPPricing
Search components ⌘K
Web
App
Favorites
Close sidebar
Join

Menu

ComponentsBlogMCPPricingShowcaseAboutHelp
Web
App

Get Started

IntroductionInstallationGetting StartedComponentsTheme ManagerTemplatesMCPWhy Uilora?

Crazy Components

404 PageDig HoleImage SliderFlower AnimationImage Trail EffectLiquid RevealPrismRussian WebsiteSketchy LineSlider PageNeon RibbonGrid Distortion

Core Landing Pages

Hero Sections10+
Complete Landing Pages21+
Startup Landing9+
SaaS Dashboards15+
Agency Portfolio21+
Auth6+

Backgrounds & Visuals

Backgrounds23+
Gradient Packs9+
Blurred Backgrounds9+
Pattern Backgrounds5+
Noise Textures6+

Navigation & Structure

Navbar6+
Footers12+
Mega Menus21+
Chat UI11+

UI Components

Forms23+
Buttons4+
Cards11+
Toasts8+
File Uploads8+
Modals & Design8+

Grids & Layouts

Bento Grids8+
Feature Grids11+
Gallery Grids17+
Masonry Grids12+

Media

Image Galleries10+
Lightboxes13+
Video Players5+
Testimonials Media11+

Content Blocks

Feature Sections8+
Testimonials20+
Stats Sections9+
Pricing18+
FAQ16+
Timeline8+
Pagination10+

Animations & Motion

Skeletons Loader5+
Parallax Scroll6+
Scroll Reveals14+
Text Animations12+
Magnetic Cursor7+
3D Transforms4+

Special Elements

Accordions9+
Tabs6+
Carousels9+
Badges5+
Avatars4+
Breadcrumbs4+
Selector5+
Tables13+
Sign In
Uilora

Main Navigation

ComponentsBlogMCPPricing

Environment

Get Started

IntroductionInstallationGetting StartedComponentsTheme ManagerTemplatesMCPWhy Uilora?

Crazy Components

404 PageDig HoleImage SliderFlower AnimationImage Trail EffectLiquid RevealPrismRussian WebsiteSketchy LineSlider PageNeon RibbonGrid Distortion

Core Landing Pages

Hero Sections10+
Complete Landing Pages21+
Startup Landing9+
SaaS Dashboards15+
Agency Portfolio21+
Auth6+

Backgrounds & Visuals

Backgrounds23+
Gradient Packs9+
Blurred Backgrounds9+
Pattern Backgrounds5+
Noise Textures6+

Navigation & Structure

Navbar6+
Footers12+
Mega Menus21+
Chat UI11+

UI Components

Forms23+
Buttons4+
Cards11+
Toasts8+
File Uploads8+
Modals & Design8+

Grids & Layouts

Bento Grids8+
Feature Grids11+
Gallery Grids17+
Masonry Grids12+

Media

Image Galleries10+
Lightboxes13+
Video Players5+
Testimonials Media11+

Content Blocks

Feature Sections8+
Testimonials20+
Stats Sections9+
Pricing18+
FAQ16+
Timeline8+
Pagination10+

Animations & Motion

Skeletons Loader5+
Parallax Scroll6+
Scroll Reveals14+
Text Animations12+
Magnetic Cursor7+
3D Transforms4+

Special Elements

Accordions9+
Tabs6+
Carousels9+
Badges5+
Avatars4+
Breadcrumbs4+
Selector5+
Tables13+
Join Uilora Community
ComponentsCore Landing Pages

OTP Code

Free

One-time password verification with auto-focus, keyboard navigation, and resend cooldown timer. Features animated input fields with glow effects and focus states.

Refresh preview
Share Component
Copy CLI command

OTP Code

Props

titlestring

Title text displayed at the top of the form.

Default: "Verify Identity"

subtitlestring

Subtitle text displayed below the title.

Default: "Enter the 4-digit code sent to your device."

lengthnumber

Number of OTP code digits.

Default: 4

onComplete(code: string) => void

Callback function called when OTP code is complete.

Default: undefined

onResend() => void

Callback function called when resend button is clicked.

Default: undefined

resendCooldownnumber

Cooldown time in seconds before resend is allowed.

Default: 30

classNamestring

Additional CSS classes for custom styling.

Default: undefined

autoFocusboolean

Whether to automatically focus the first input field.

Default: true

When to use

Perfect for security tools, banking apps, and Next.js platforms that require 2FA or device verification. Use this React component for an OTP (One-Time Password) experience with auto-focus inputs and technical glow effects.

Best practices

Follow React best practices by managed the keyboard focus flow across inputs. Maintain scalable component architecture by keeping the code length configurable. Optimize for performance by managed the resend timer efficiently.

Why it matters

Smooth OTP flows reduce user drop-off during sensitive verification steps. This production-ready UI component helps you build an interface that feels precise and secure, improving the overall reliability of your authentication process.

Frequently asked questions

Does it auto-focus?

Yes, the component automatically focuses the first digit field on mount and moves the cursor forward as the user types or pastes the code.

Can I use 6 digits?

The `length` prop defaults to 4 but can be set to 6 or any other number to match your platform's security requirements.

What is the resend cooldown?

The `resendCooldown` prop (default 30s) prevents spam by disabling the resend button until the countdown reaches zero.
PreviousGlass ForgotNextSplit Signup

Related components

  • CartoonishPlayful cartoon-style hero section with fun animations and vibrant colors.
  • DraggableInteractive hero section with draggable elements and smooth physics-based interactions.
  • Glass Operating SystemGlassmorphism hero section with frosted glass effects and modern OS-inspired design.

Unlock the full library with one payment.

Contribute FeedbackCompare plans
Uilora

A curated collection of high-fidelity components designed to build modern web interfaces with speed and precision.

Contact

support@uilora.comGitHub
Product Hunt
Featured onProduct Hunt

Web Library

  • Web Components
  • Documentation
  • Pricing
  • MCP Server

App Library

  • Mobile Components
  • Platform Notes
  • Installation

Resources

  • Showcase
  • Blog
  • FAQ
  • Contribute
  • GitHub

Support

  • About Us
  • Help Center
  • Feedback
  • Privacy Policy
  • Terms of Service

© 2026 Uilora UI. All rights reserved.

PrivacyTermsFeedback
Made withbynitin14gupta