Skip to content
Forms

Input OTP

One-time-code input with slots.

Import

tsx
import { InputOTP } from "@cronus-ui/ui";
bash
npx cronus-ui add input-otp

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component InputOtpDefault layout:inline style:input-otp {
  aria-label:"One-time passcode"
  label "One-time passcode"
}

page "/audit/input-otp/default" type:custom {
  use InputOtpDefault
}

API Reference

Generated from the component's exported types.

InputOTPProps

Extends ComponentPropsWithoutRef<typeof OTPInput>

Skip InputOTPProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
maxLength
number——
value
string—Controlled value.
onChange
(value: string) => void—Called when the value changes.
disabled
boolean—Disables pointer and keyboard interaction.

InputOTPGroupProps

Extends HTMLAttributes<HTMLDivElement>

Skip InputOTPGroupProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

InputOTPSlotProps

Extends HTMLAttributes<HTMLDivElement>

Skip InputOTPSlotProps props table
PropTypeDefaultDescription
index*
number——
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

InputOTPSeparatorProps

Extends HTMLAttributes<HTMLDivElement>

Skip InputOTPSeparatorProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.