AsterUIDocsv1.0.2

Docs / Component reference

InputOTP

Enter a verification code one character at a time, or paste the entire code into the field.

One-time code example

Install

sh
npx @fierst/ui@1.0.2 add input-otp

Registry dependencies: theme.

Exports from ./ui/input-otp: InputOTP.

Download the registry source for input-otp 1.0.2.

API contracts

ts
export function* InputOTP(
  props: {
    length?: number;
    value?: string;
    defaultValue?: string;
    label?: string;
    hint?: string;
    separatorAt?: number;
    disabled?: boolean;
    onChange?: (code: string) => void;
    onComplete?: (code: string) => void;
    class?: string;
  },
  ctx: Ctx,
)