Command Palette

Search for a command to run...

Docs
OTP Field

OTP Field

A customizable OTP (One-Time Password) input field with auto-focus and paste support

Loading...

Installation

Props

PropTypeDefaultDescription
labelstring"Enter OTP"The label for the OTP field
lengthnumber6Number of OTP digits
separatorbooleantrueShow separator between digit groups
onComplete(otp: string) => voidundefinedCallback when OTP is complete

Features

  • Auto-Focus: Automatically moves to the next input when a digit is entered
  • Paste Support: Handles pasted OTP codes and distributes digits automatically
  • Backspace Navigation: Smart backspace behavior for easy editing
  • Visual Separator: Optional separator line between digit groups
  • Completion Callback: Triggers callback when all digits are entered
  • Numeric Only: Accepts only numeric input (0-9)