Lumeo

OTP Input

A one-time password input with auto-focus and auto-advance between fields.

Installation

dotnet add package Lumeo

One-time app setup (AddLumeo(), CSS & JS) is covered in the installation guide.

Usage

@using Lumeo

<OtpInput />

When to Use

  • Verification code entry for email or SMS confirmation
  • Two-factor authentication (2FA) flows
  • PIN entry screens for secure access
  • Any scenario requiring a fixed-length numeric or alphanumeric code

Two-factor authentication

Enter the 6-digit code from your authenticator app.

Length:

Dynamically change the number of OTP digits.

Try pasting a code like "123456" into any field

API Reference

OtpInput

Prop Type Default Description
Lengthint6Number of input fields.
Valuestring""Current OTP value. Use with @bind-Value for two-way binding.
ValueChangedEventCallback<string>Callback invoked when the value changes.
OnCompleteEventCallback<string>Callback invoked when all fields are filled.
InputModestring"Numeric"Input validation mode. Values: "Numeric", "Alphanumeric", "Password".
DisabledboolfalseDisables all input fields.
MaskedboolfalseHides input characters (password-style).
Separatorstring?nullCharacter displayed between groups (e.g. "-").
GroupSizesint[]?nullDefines how inputs are grouped (e.g. [3,3] for two groups of three).
Classstring?nullAdditional CSS classes.
AdditionalAttributesDictionary<string, object>?nullAdditional HTML attributes.
RequiredboolfalseMarks the field as required for form validation.
InvalidboolfalseApplies error styling to indicate a validation error.
ErrorTextstring?nullError message shown below when Invalid is true (standalone).
HelperTextstring?nullHelp text shown below when there is no error (standalone).
Labelstring?nullInline label rendered above the input (standalone).
Namestring?nullHTML name attribute for form identification.
FormFieldFormFieldContext?nullCascaded context from a parent FormField; drives validation state automatically.
  • Input — Standard text input for general free-form text
  • PasswordInput — Password field with visibility toggle and strength meter
  • Form — Combine OtpInput with form validation and labels