Skip to content
SevenUI
Sign in
On this page

Input OTP

Displays an OTP input field built on the Base UI OTPField primitive.

Installation

Bash

Usage

Examples

Masked

API reference

InputOTP

Extends the Base UI OTP Field Root — all its props apply. No third-party input-otp package required.

PropTypeDefault
lengthnumber (required)—
value / defaultValuestring—
onValueChange(value: string) => void—
onValueComplete(value: string) => void — all slots filled—
validationType"numeric" | "alpha" | "alphanumeric" | "none""numeric"
maskbooleanfalse
autoSubmitboolean — submit the owning form when completefalse

InputOTPSlot

Extends the Base UI Input part — each slot is a real single-character input; render exactly length of them. Focus styling replaces the old fake-caret behavior.

InputOTPGroup and InputOTPSeparator

InputOTPGroup (a div) draws the joined slot borders and rounded ends; InputOTPSeparator extends the Base UI Separator and renders a minus icon between groups.

Was this page helpful?