# InputOTP Enter a verification code in one accessible input, with individual slots for each character. [Interactive guide](/docs/components/input-otp) · Forge 3.2.0 Use the API for your installed version. Run `npx --no-install wss3-forge api --json` inside the project. ## Implementation guidance ### When to use it Use InputOTP for a pasteable verification code with a single native input. Set type=password and a numeric pattern for a masked PIN. ### How to compose it Render one indexed slot per character and keep the code as text to preserve leading zeroes. Choose a matching pattern and provide a label. ### What to verify Paste a formatted code, check leading zeroes and verify that completion and rejection are represented separately. ## Usage ```tsx import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from 'wss3-forge' ``` - Set maxLength and render one InputOTPSlot per character, using zero-based indexes across every group. InputOTPSeparator separates groups visually. A single named native input handles selection, paste, autofill and form submission. - Use REGEXP_ONLY_DIGITS, REGEXP_ONLY_CHARS or REGEXP_ONLY_DIGITS_AND_CHARS for input filtering. Set inputMode="text" when accepting letters. Use pasteTransformer to remove formatting before a paste. - Use value with onChange for a controlled code, or defaultValue for initial content. onComplete receives a completed code. Use aria-invalid with a linked explanation for a rejected code. - Live examples set autoComplete="off" because the page contains several independent code fields. A verification screen with a single active code field can use the default one-time-code hint. - Use required to require all slots, or supply minLength explicitly. Set type="password" to mask the built-in slots. Group and slot props accept native DOM attributes. Use size="lg" for larger slots. - For a PIN, set a numeric pattern and type="password" to mask the slots. Keep the form value as a string so leading zeroes survive. ```tsx {Array.from({ length: 6 }, (_, index) => )} ``` ## Runnable examples ### Six-digit code ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, useContext } from 'react' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function SixDigits() { const { InputOTP, InputOTPGroup, InputOTPSlot } = useContext(OTPLibrary) return {Array.from({ length: 6 }, (_, index) => )} } export default function Example() { return () } ``` ### Pattern ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, REGEXP_ONLY_DIGITS, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` ### Separator ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` ### Disabled ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` ### Controlled ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId, useState } from 'react' import { Label, REGEXP_ONLY_DIGITS, Text, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } function ControlledCode() { const [value, setValue] = useState('') return {value ? 'You entered: ' + value : 'Enter a six-digit code.'} } export default function Example() { return () } ``` ### Invalid ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId, useState } from 'react' import { FieldError, Label, REGEXP_ONLY_DIGITS, Text, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } function RejectedCode() { const [code, setCode] = useState('000000') const id = useId() const rejected = code.length === 6 && code !== '123456' return {rejected ? That code has expired. Try 123456. : {code === '123456' ? 'Code accepted.' : 'Enter the replacement code 123456.'}} } export default function Example() { return () } ``` ### Four digits ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, REGEXP_ONLY_DIGITS, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` ### Alphanumeric ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, REGEXP_ONLY_DIGITS_AND_CHARS, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` ### Formatted paste ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, REGEXP_ONLY_DIGITS, Text, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } function FormattedPaste() { const hint = useId() return text.replace(/[\s-]/g, '')} aria-describedby={hint} /> Try pasting 42-18 07. } export default function Example() { return () } ``` ### Form ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId, useRef, useState, type FormEvent } from 'react' import { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, FieldError, HStack, Label, REGEXP_ONLY_DIGITS, Text, VStack } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function VerificationForm() { const { InputOTP } = useContext(OTPLibrary) const id = useId() const input = useRef(null) const [code, setCode] = useState('') const [issued, setIssued] = useState(0) const [result, setResult] = useState<'idle' | 'incomplete' | 'rejected' | 'replaced' | 'verified'>('idle') const demoCodes = ['123456', '654321', '407218'] const expected = demoCodes[issued] const error = result === 'incomplete' ? 'Enter all six digits.' : result === 'rejected' ? 'That code does not match the current demo code.' : '' function verify(event: FormEvent) { event.preventDefault() if (code === expected) setResult('verified') else { setResult(code.length !== 6 ? 'incomplete' : 'rejected') input.current?.focus() } } function resend() { setIssued(index => (index + 1) % demoCodes.length) setCode('') setResult('replaced') input.current?.focus() } return
Verify your login Use the demo code {expected} to continue. { setCode(next); setResult('idle') }}> {error && {error}} {result === 'replaced' && A new demo code is ready.} {result === 'verified' && Code verified.}
} export default function Example() { return () } ``` ### RTL ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } function RightToLeft() { return
} export default function Example() { return () } ``` ### Compact OTP field ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, REGEXP_ONLY_DIGITS, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` ### Masked PIN field ```tsx import * as ForgeOTP from 'wss3-forge' import { createContext, Fragment, useContext, useId } from 'react' import { Label, REGEXP_ONLY_DIGITS, VStack, type InputOTPProps } from 'wss3-forge' type OTPParts = Pick const OTPLibrary = createContext(ForgeOTP) function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { const { InputOTPGroup, InputOTPSlot, InputOTPSeparator } = useContext(OTPLibrary) return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const { InputOTP } = useContext(OTPLibrary) const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` ## Primitive libraries ### Base UI This entry re-exports the shared Forge input-otp implementation. Its form behavior, keyboard editing and paste filtering match the other two entries. All three entries use input-otp and expose the same Forge slots, groups and separators. ```sh npm install wss3-forge @base-ui/react ``` ```tsx import { InputOTP, InputOTPGroup, InputOTPSlot } from 'wss3-forge/base-ui' function SixDigits() { return {Array.from({ length: 6 }, (_, index) => )} } export default function Example() { return () } ``` #### Pattern ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Separator ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Disabled ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Controlled ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId, useState } from 'react' import { Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function ControlledCode() { const [value, setValue] = useState('') return {value ? 'You entered: ' + value : 'Enter a six-digit code.'} } export default function Example() { return () } ``` #### Invalid ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId, useState } from 'react' import { FieldError, Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function RejectedCode() { const [code, setCode] = useState('000000') const id = useId() const rejected = code.length === 6 && code !== '123456' return {rejected ? That code has expired. Try 123456. : {code === '123456' ? 'Code accepted.' : 'Enter the replacement code 123456.'}} } export default function Example() { return () } ``` #### Four digits ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Alphanumeric ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS_AND_CHARS, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Formatted paste ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId } from 'react' import { Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function FormattedPaste() { const hint = useId() return text.replace(/[\s-]/g, '')} aria-describedby={hint} /> Try pasting 42-18 07. } export default function Example() { return () } ``` #### Form ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS } from 'wss3-forge/base-ui' import { Fragment, useId, useRef, useState, type FormEvent } from 'react' import { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, FieldError, HStack, Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function VerificationForm() { const id = useId() const input = useRef(null) const [code, setCode] = useState('') const [issued, setIssued] = useState(0) const [result, setResult] = useState<'idle' | 'incomplete' | 'rejected' | 'replaced' | 'verified'>('idle') const demoCodes = ['123456', '654321', '407218'] const expected = demoCodes[issued] const error = result === 'incomplete' ? 'Enter all six digits.' : result === 'rejected' ? 'That code does not match the current demo code.' : '' function verify(event: FormEvent) { event.preventDefault() if (code === expected) setResult('verified') else { setResult(code.length !== 6 ? 'incomplete' : 'rejected') input.current?.focus() } } function resend() { setIssued(index => (index + 1) % demoCodes.length) setCode('') setResult('replaced') input.current?.focus() } return
Verify your login Use the demo code {expected} to continue. { setCode(next); setResult('idle') }}> {error && {error}} {result === 'replaced' && A new demo code is ready.} {result === 'verified' && Code verified.}
} export default function Example() { return () } ``` #### RTL ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/base-ui' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function RightToLeft() { return
} export default function Example() { return () } ``` ### Radix This entry re-exports the shared Forge input-otp implementation. Its form behavior, keyboard editing and paste filtering match the other two entries. All three entries use input-otp and expose the same Forge slots, groups and separators. ```sh npm install wss3-forge radix-ui ``` ```tsx import { InputOTP, InputOTPGroup, InputOTPSlot } from 'wss3-forge/radix' function SixDigits() { return {Array.from({ length: 6 }, (_, index) => )} } export default function Example() { return () } ``` #### Pattern ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Separator ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Disabled ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Controlled ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId, useState } from 'react' import { Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function ControlledCode() { const [value, setValue] = useState('') return {value ? 'You entered: ' + value : 'Enter a six-digit code.'} } export default function Example() { return () } ``` #### Invalid ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId, useState } from 'react' import { FieldError, Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function RejectedCode() { const [code, setCode] = useState('000000') const id = useId() const rejected = code.length === 6 && code !== '123456' return {rejected ? That code has expired. Try 123456. : {code === '123456' ? 'Code accepted.' : 'Enter the replacement code 123456.'}} } export default function Example() { return () } ``` #### Four digits ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Alphanumeric ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS_AND_CHARS, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Formatted paste ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId } from 'react' import { Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function FormattedPaste() { const hint = useId() return text.replace(/[\s-]/g, '')} aria-describedby={hint} /> Try pasting 42-18 07. } export default function Example() { return () } ``` #### Form ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS } from 'wss3-forge/radix' import { Fragment, useId, useRef, useState, type FormEvent } from 'react' import { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, FieldError, HStack, Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function VerificationForm() { const id = useId() const input = useRef(null) const [code, setCode] = useState('') const [issued, setIssued] = useState(0) const [result, setResult] = useState<'idle' | 'incomplete' | 'rejected' | 'replaced' | 'verified'>('idle') const demoCodes = ['123456', '654321', '407218'] const expected = demoCodes[issued] const error = result === 'incomplete' ? 'Enter all six digits.' : result === 'rejected' ? 'That code does not match the current demo code.' : '' function verify(event: FormEvent) { event.preventDefault() if (code === expected) setResult('verified') else { setResult(code.length !== 6 ? 'incomplete' : 'rejected') input.current?.focus() } } function resend() { setIssued(index => (index + 1) % demoCodes.length) setCode('') setResult('replaced') input.current?.focus() } return
Verify your login Use the demo code {expected} to continue. { setCode(next); setResult('idle') }}> {error && {error}} {result === 'replaced' && A new demo code is ready.} {result === 'verified' && Code verified.}
} export default function Example() { return () } ``` #### RTL ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/radix' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function RightToLeft() { return
} export default function Example() { return () } ``` ### React Aria This entry re-exports the shared Forge input-otp implementation. Its form behavior, keyboard editing and paste filtering match the other two entries. All three entries use input-otp and expose the same Forge slots, groups and separators. ```sh npm install wss3-forge react-aria-components ``` ```tsx import { InputOTP, InputOTPGroup, InputOTPSlot } from 'wss3-forge/react-aria' function SixDigits() { return {Array.from({ length: 6 }, (_, index) => )} } export default function Example() { return () } ``` #### Pattern ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Separator ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Disabled ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Controlled ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId, useState } from 'react' import { Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function ControlledCode() { const [value, setValue] = useState('') return {value ? 'You entered: ' + value : 'Enter a six-digit code.'} } export default function Example() { return () } ``` #### Invalid ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId, useState } from 'react' import { FieldError, Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function RejectedCode() { const [code, setCode] = useState('000000') const id = useId() const rejected = code.length === 6 && code !== '123456' return {rejected ? That code has expired. Try 123456. : {code === '123456' ? 'Code accepted.' : 'Enter the replacement code 123456.'}} } export default function Example() { return () } ``` #### Four digits ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Alphanumeric ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS_AND_CHARS, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } export default function Example() { return () } ``` #### Formatted paste ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId } from 'react' import { Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function FormattedPaste() { const hint = useId() return text.replace(/[\s-]/g, '')} aria-describedby={hint} /> Try pasting 42-18 07. } export default function Example() { return () } ``` #### Form ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, REGEXP_ONLY_DIGITS } from 'wss3-forge/react-aria' import { Fragment, useId, useRef, useState, type FormEvent } from 'react' import { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, FieldError, HStack, Label, Text, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function VerificationForm() { const id = useId() const input = useRef(null) const [code, setCode] = useState('') const [issued, setIssued] = useState(0) const [result, setResult] = useState<'idle' | 'incomplete' | 'rejected' | 'replaced' | 'verified'>('idle') const demoCodes = ['123456', '654321', '407218'] const expected = demoCodes[issued] const error = result === 'incomplete' ? 'Enter all six digits.' : result === 'rejected' ? 'That code does not match the current demo code.' : '' function verify(event: FormEvent) { event.preventDefault() if (code === expected) setResult('verified') else { setResult(code.length !== 6 ? 'incomplete' : 'rejected') input.current?.focus() } } function resend() { setIssued(index => (index + 1) % demoCodes.length) setCode('') setResult('replaced') input.current?.focus() } return
Verify your login Use the demo code {expected} to continue. { setCode(next); setResult('idle') }}> {error && {error}} {result === 'replaced' && A new demo code is ready.} {result === 'verified' && Code verified.}
} export default function Example() { return () } ``` #### RTL ```tsx import { InputOTPGroup, InputOTPSlot, InputOTPSeparator, InputOTP, type InputOTPProps } from 'wss3-forge/react-aria' import { Fragment, useId } from 'react' import { Label, VStack } from 'wss3-forge' function Slots({ groups, large = false }: { groups: number[]; large?: boolean }) { return <>{groups.map((length, group) => { const offset = groups.slice(0, group).reduce((total, count) => total + count, 0) return {group > 0 && } {Array.from({ length }, (_, index) => )} })} } function CodeExample({ groups = [6], label, ...props }: Omit & { groups?: number[]; label?: string }) { const id = useId() return {label && } a + b, 0)}> } function RightToLeft() { return
} export default function Example() { return () } ``` ## Root package API ### InputOTP Enter a verification code in one accessible input, with individual slots for each character. Props type: `InputOTPProps` Native attributes: AriaAttributes, DOMAttributes, HTMLAttributes, InputHTMLAttributes **Composition exports** - `InputOTPGroup` (named export) - `InputOTPSlot` (named export) - `InputOTPSeparator` (named export) - `defaultValue?` — `string | number | readonly string[] | undefined` Initial code and reset value for an uncontrolled input. - `inputMode?` — `"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined` Options `"none"`, `"search"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`. Hints at the type of data that might be entered by the user while editing the element or its contents - `aria-describedby?` — `string | undefined` Identifies the element (or elements) that describes the object. - `aria-invalid?` — `boolean | "true" | "false" | "grammar" | "spelling" | undefined` Options `false`, `true`, `"true"`, `"false"`, `"grammar"`, `"spelling"`. Indicates the entered value does not conform to the format expected by the application. - `disabled?` — `boolean | undefined` Disable input and exclude the code from form data. - `type?` — `React.HTMLInputTypeAttribute | undefined` Set password to mask characters in the built-in slots. - `form?` — `string | undefined` ID of the form that owns this input. - `name?` — `string | undefined` Name under which the code is submitted. - `pattern?` — `string | undefined` Regular expression applied to the code. Use REGEXP_ONLY_DIGITS for a numeric code. - `autoComplete?` — `React.HTMLInputAutoCompleteAttribute | undefined` Autofill hint passed to the native input. - `minLength?` — `number | undefined` Override the minimum length for native form validation. - `readOnly?` — `boolean | undefined` Keep the code focusable and included in form data while preventing edits. - `required?` — `boolean | undefined` Require a complete code during native form validation unless minLength is explicitly set. - `value?` — `string | undefined` Current code for a controlled input. - `onChange?` — `((newValue: string) => unknown) | undefined` Receives the edited code as a string. - `maxLength` — `number` Number of characters in a complete code. Provide a slot for each character. - `textAlign?` — `"center" | "left" | "right" | undefined` Options `"center"`, `"left"`, `"right"`. Text alignment of the underlying input. - `onComplete?` — `((...args: any[]) => unknown) | undefined` Runs when an edit fills the code to maxLength. - `pushPasswordManagerStrategy?` — `"none" | "increase-width" | undefined` Options `"none"`, `"increase-width"`. Controls how the native input makes room for password manager badges. - `pasteTransformer?` — `((pasted: string) => string) | undefined` Normalizes clipboard text before validating it against the pattern. - `containerClassName?` — `string | undefined` Class applied to the outer input container. - `ref?` — `React.LegacyRef | undefined` #### Form 1 Native attributes: AriaAttributes, DOMAttributes, HTMLAttributes, InputHTMLAttributes Excluded props: children - `defaultValue?` — `string | number | readonly string[] | undefined` Initial code and reset value for an uncontrolled input. - `inputMode?` — `"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined` Options `"none"`, `"search"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`. Hints at the type of data that might be entered by the user while editing the element or its contents - `aria-describedby?` — `string | undefined` Identifies the element (or elements) that describes the object. - `aria-invalid?` — `boolean | "true" | "false" | "grammar" | "spelling" | undefined` Options `false`, `true`, `"true"`, `"false"`, `"grammar"`, `"spelling"`. Indicates the entered value does not conform to the format expected by the application. - `disabled?` — `boolean | undefined` Disable input and exclude the code from form data. - `type?` — `React.HTMLInputTypeAttribute | undefined` Set password to mask characters in the built-in slots. - `form?` — `string | undefined` ID of the form that owns this input. - `name?` — `string | undefined` Name under which the code is submitted. - `pattern?` — `string | undefined` Regular expression applied to the code. Use REGEXP_ONLY_DIGITS for a numeric code. - `autoComplete?` — `React.HTMLInputAutoCompleteAttribute | undefined` Autofill hint passed to the native input. - `minLength?` — `number | undefined` Override the minimum length for native form validation. - `readOnly?` — `boolean | undefined` Keep the code focusable and included in form data while preventing edits. - `required?` — `boolean | undefined` Require a complete code during native form validation unless minLength is explicitly set. - `value?` — `string | undefined` Current code for a controlled input. - `onChange?` — `((newValue: string) => unknown) | undefined` Receives the edited code as a string. - `maxLength` — `number` Number of characters in a complete code. Provide a slot for each character. - `textAlign?` — `"center" | "left" | "right" | undefined` Options `"center"`, `"left"`, `"right"`. Text alignment of the underlying input. - `onComplete?` — `((...args: any[]) => unknown) | undefined` Runs when an edit fills the code to maxLength. - `pushPasswordManagerStrategy?` — `"none" | "increase-width" | undefined` Options `"none"`, `"increase-width"`. Controls how the native input makes room for password manager badges. - `pasteTransformer?` — `((pasted: string) => string) | undefined` Normalizes clipboard text before validating it against the pattern. - `containerClassName?` — `string | undefined` Class applied to the outer input container. #### Form 2 Native attributes: AriaAttributes, DOMAttributes, HTMLAttributes, InputHTMLAttributes Excluded props: render - `defaultValue?` — `string | number | readonly string[] | undefined` Initial code and reset value for an uncontrolled input. - `inputMode?` — `"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined` Options `"none"`, `"search"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`. Hints at the type of data that might be entered by the user while editing the element or its contents - `aria-describedby?` — `string | undefined` Identifies the element (or elements) that describes the object. - `aria-invalid?` — `boolean | "true" | "false" | "grammar" | "spelling" | undefined` Options `false`, `true`, `"true"`, `"false"`, `"grammar"`, `"spelling"`. Indicates the entered value does not conform to the format expected by the application. - `disabled?` — `boolean | undefined` Disable input and exclude the code from form data. - `type?` — `React.HTMLInputTypeAttribute | undefined` Set password to mask characters in the built-in slots. - `form?` — `string | undefined` ID of the form that owns this input. - `name?` — `string | undefined` Name under which the code is submitted. - `pattern?` — `string | undefined` Regular expression applied to the code. Use REGEXP_ONLY_DIGITS for a numeric code. - `autoComplete?` — `React.HTMLInputAutoCompleteAttribute | undefined` Autofill hint passed to the native input. - `minLength?` — `number | undefined` Override the minimum length for native form validation. - `readOnly?` — `boolean | undefined` Keep the code focusable and included in form data while preventing edits. - `required?` — `boolean | undefined` Require a complete code during native form validation unless minLength is explicitly set. - `value?` — `string | undefined` Current code for a controlled input. - `onChange?` — `((newValue: string) => unknown) | undefined` Receives the edited code as a string. - `maxLength` — `number` Number of characters in a complete code. Provide a slot for each character. - `textAlign?` — `"center" | "left" | "right" | undefined` Options `"center"`, `"left"`, `"right"`. Text alignment of the underlying input. - `onComplete?` — `((...args: any[]) => unknown) | undefined` Runs when an edit fills the code to maxLength. - `pushPasswordManagerStrategy?` — `"none" | "increase-width" | undefined` Options `"none"`, `"increase-width"`. Controls how the native input makes room for password manager badges. - `pasteTransformer?` — `((pasted: string) => string) | undefined` Normalizes clipboard text before validating it against the pattern. - `containerClassName?` — `string | undefined` Class applied to the outer input container. ### InputOTPGroup Props type: `HTMLAttributes` Native attributes: AriaAttributes, DOMAttributes, HTMLAttributes - `ref?` — `React.LegacyRef | undefined` ### InputOTPSlot Props type: `InputOTPSlotProps` Native attributes: AriaAttributes, DOMAttributes, HTMLAttributes - `index` — `number` - `size?` — `'default' | 'lg'` Default `'default'`. Options `"default"`, `"lg"`. - `ref?` — `React.LegacyRef | undefined` ### InputOTPSeparator Props type: `HTMLAttributes` Native attributes: AriaAttributes, DOMAttributes, HTMLAttributes - `ref?` — `React.LegacyRef | undefined` ## Related types ```ts export type InputOTPProps = PrimitiveProps export interface InputOTPSlotProps extends HTMLAttributes { index: number; size?: 'default' | 'lg' } ``` ## Optional primitive contracts - [wss3-forge/base-ui · InputOTP contract](/ai/skill/primitive-api/InputOTP.json) - [wss3-forge/radix · InputOTP contract](/ai/skill/primitive-api/InputOTP.json) - [wss3-forge/react-aria · InputOTP contract](/ai/skill/primitive-api/InputOTP.json)