# Input OTP

> A segmented input for one-time passcodes.

_Updated: 2026-06-04_

A segmented input for one-time passcodes.

## Installation

```bash
railbase ui add input-otp
```

> [!NOTE]
> `railbase ui add` also copies shared primitives — they ship alongside this component automatically.

## Usage

```tsx
import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/lib/ui/input-otp";

<InputOTP maxLength={6}>
  <InputOTPGroup>
    <InputOTPSlot index={0} />
    <InputOTPSlot index={1} />
    <InputOTPSlot index={2} />
  </InputOTPGroup>
</InputOTP>
```

## Anatomy

Exported parts: `InputOTP` · `InputOTPGroup` · `InputOTPSlot` · `InputOTPSeparator` · `OtpField`
