콘텐츠로 이동
RefineUI

Input OTP

일회용 비밀번호 코드 입력 필드.

Overview

Machine-readable contract from Component Spec.

component: input-otpexport: InputOTPversion: 1attributes: data-refineui=input-otp

Anatomy

Partdata-refineui
rootinput-otp
slotinput-otp-slot

Variants

AxisValues
sizesm, md, lg

Accessibility

SlotElementRole
input-otpdivgroup

Keyboard

KeyActionNative
ArrowLeftprevious-trigger
ArrowRightnext-trigger

Layout

PropertyValue
directionlogical
rtltrue
npm install @refineui/react @refineui/tokens
import { InputOTP, InputOTPSlot } from "@refineui/react";
<InputOTP maxLength={6} value={code} onValueChange={setCode}>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTP>
<InputOTP
maxLength={4}
pattern={/\d/}
size="lg"
aria-label="Enter verification code"
/>
PropDefaultTypeDescription
valuestring제어형 OTP 문자열.
defaultValuestring비제어형 초기 값.
onValueChange(value: string) => void값 변경 시 이벤트 핸들러.
maxLengthnumber슬롯 수(필수).
pattern/\d/RegExp문자별 허용 목록(기본: 숫자만).
size"md""sm" | "md" | "lg"컨트롤 크기 티어.
disabledfalseboolean인터랙션을 비활성화합니다.
autoFocusfalseboolean마운트 시 자동 포커스.
aria-labelstring컨트롤의 접근 가능한 이름.
PropDefaultTypeDescription
indexnumber0부터 시작하는 슬롯 인덱스(필수).