Components
Components
InputOTP
Segmented one-time code entry with paste and keyboard navigation.
newfree
pnpm add @komponents/uiCanonical TypeScript source · tree-shakeable subpathsCompositional OTP control for email codes and short PINs. Digits advance on entry, Backspace retreats, and paste fills the whole code.
Email code
Paste works across all digits.
Backup PIN
That code expired.
Usage
Props
length— digit count (default6)onComplete— fires when every slot is filled- Shared field variants and sizes
States
- Description helper text
- Invalid +
errorMessage - Disabled
- Controlled
valueordefaultValue
Accessibility
- Group role with labeled digit slots
- Arrow keys move between digits
- Hidden
nameinput for form submission when provided