Showcase

Blazor OTP Input

The OTPInput component lets users enter a one-time password (OTP) in separate fields, one character each, for sign-in and verification flows. The examples below cover events as the code is typed and completed, and a custom code length.
API Documentation

How it works #

The OTPInput component provides a user-friendly interface for entering one-time passwords (OTP), commonly used for authentication and verification flows.

How to use:
  1. Add the OTPInput component to your page.
  2. Handle the OnOTPChanged event to capture the OTP value as the user types.
  3. Handle the OnOTPCompleted event to respond when the user has entered the complete OTP.
  4. Bind the entered OTP to a variable for display or further processing as needed.
This demo illustrates the basic usage of the OTPInput component, including event handling for OTP entry and completion.

Length #

The OTPInput component allows you to specify the required OTP length, adapting the number of input fields accordingly.

How to use:
  1. Set the Length parameter to define how many digits or characters the OTP should have (e.g., Length="5").
  2. Handle the OnOTPChanged and OnOTPCompleted events as shown in the demo to process the OTP input.
  3. Display or use the entered OTP value as needed in your application.
This demo demonstrates how to configure the OTPInput component for a custom OTP length and handle user input accordingly.

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 reload the page.