# Input OTP
> One-time password input field with auto-focus and grouping.
Source: https://shellui.dev/docs/v0.3/components/form/input-otp
The InputOTP component provides a multi-digit input for one-time passwords and verification codes with auto-focus navigation.
## Installation
```bash
shellui add input-otp
```
## Usage
### Basic
```razor
@code {
private string otpCode = "";
private void HandleChanged(string value)
{
otpCode = value;
}
}
```
### Two-way Binding
```razor
@code {
private string otpCode = "";
}
```
### Custom Length
```razor
@code {
private string otpCode = "";
}
```
### With Grouping
Groups digits with a separator. For example, `Length="6"` and `GroupBy="3"` displays as `[1][2][3] - [4][5][6]`.
```razor
@code {
private string otpCode = "";
}
```
### With Completion Handler
```razor
@code {
private string otpCode = "";
private void HandleComplete(string value)
{
// All digits entered — verify the code
}
}
```
### With Label
```razor
We sent a code to your email
@code {
private string code = "";
}
```
### Disabled
```razor
```
## API Reference
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `Value` | `string` | `""` | Current OTP value |
| `ValueChanged` | `EventCallback` | — | Fires when value changes |
| `OnComplete` | `EventCallback` | — | Fires when all digits are entered |
| `Length` | `int` | `6` | Number of input digits |
| `GroupBy` | `int` | `3` | Group digits with separator (0 to disable) |
| `Disabled` | `bool` | `false` | Disables the input |
| `Class` | `string?` | `null` | Additional CSS classes |
## Accessibility
- Input attributes: `inputmode="numeric"`, `pattern="[0-9]*"`
- Auto-focus advances to next input on digit entry
- Backspace clears current and moves to previous
- Arrow key navigation between inputs
- Screen reader compatible