Genesis
@stable

InputOTP

One-time password / code entry with slot composition.

InputOTP — a one-time code in boxes (input-otp), the twin of genesis-ui-native's NativeInputOTP. `pattern` is tested against the whole code, on both: pass genesis-core's `OTP_PATTERN_DIGITS` (input-otp's `REGEXP_ONLY_DIGITS`) for digits. A pasted code loses the spaces, dashes and dots it is often grouped with ("123-456"), as on the phone, unless `pasteTransformer` says otherwise.

packages/ui/src/components/ui/input-otp.tsx

Import
Subpath export: @marktiderman/genesis-ui
import { InputOTP } from "@marktiderman/genesis-ui";
Exports
Re-exported from @marktiderman/genesis-ui.
  • InputOTP
  • InputOTPGroup
  • InputOTPSlot
  • InputOTPSeparator
Components
Auto-generated from TypeScript source via react-docgen-typescript.

InputOTP

InputOTP — a one-time code in boxes (input-otp), the twin of genesis-ui-native's NativeInputOTP. `pattern` is tested against the whole code, on both: pass genesis-core's `OTP_PATTERN_DIGITS` (input-otp's `REGEXP_ONLY_DIGITS`) for digits. A pasted code loses the spaces, dashes and dots it is often grouped with ("123-456"), as on the phone, unless `pasteTransformer` says otherwise.

PropTypeDefaultDescription
maxLength*number—
containerClassNamestring—
noncestring—
noScriptCSSFallbackstring | null—
onChange((newValue: string) => unknown)—
onComplete((...args: any[]) => unknown)—
pasteTransformer((pasted: string) => string)—
pushPasswordManagerStrategyenum—
renderInputOTPRenderFn—
textAlignenum—
valuestring—

InputOTPGroup

No declared props.

InputOTPSlot

PropTypeDefaultDescription
index*number—

InputOTPSeparator

No declared props.

Storybook
Storybook hosts the canonical visual reference with controls for every variant.