Skip to content
RivetUI

Input OTP

Captures one-time passcodes through one accessible native input and a precise segmented display.

@rivetui/input-otp

Preview

Explore each composition interactively, then open its code in the same context.

Verification code

Use one native input behind a precise segmented display. 0 of 6 digits entered.

Alphanumeric

Switch the pattern and input mode when a code contains both letters and digits.

R
V
8

Invalid code

Associate the segmented input with a concise error when server-side verification fails.

0
0
0
0
0
0

Registry

Installation

Add the component source and its declared dependencies with the shadcn CLI.

Install component
bunx --bun shadcn@latest add @rivetui/input-otp
Inspect registry item

Public interface

API reference

Component-specific props are listed here. Native element and Base UI props continue to pass through.

InputOTP

PropTypeDefault
maxLengthnumberrequired
valuestring—
defaultValuestring""
onValueChange(value: string) => void—
onComplete(value: string) => void—
patternstring | RegExp—
inputModeHTMLInputModeAttribute"numeric"
autoCompletestring"one-time-code"
pasteTransformer(pasted: string) => string—
disabledbooleanfalse

InputOTPSlot

PropTypeDefault
indexnumberrequired
Rivet UI / Input OTPComponents engineered, not decorated.