Input OTP

A one-time-code field with a slot per character.

Installation

bash
shellui-native add input-otp

Platforms: MAUI · Avalonia.

Usage

Basic

Rendered with ShellUI for Blazor
-
<ui:InputOtp Length="6" Completed="OnCodeEntered" />
Avalonia, running in your browser

MAUI and Avalonia

  • MAUI uses a hidden entry with the numeric keyboard; Avalonia puts an invisible text box over the slots.
  • On Avalonia, Focus() focuses that text box.

API

Property Type Default Description
Length int 6 Number of slots.
Value string — The entered code. Two-way bindable.
IsNumeric bool true Digits only (numeric keyboard). False allows letters too.
HasError bool false Shows the destructive border and ring.
Event Arguments Description
ValueChanged string User input only: setting Value from code or a binding doesn't raise ValueChanged or Completed.
Completed string Raised when every slot is filled.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.