OTPInput

This documentation provides a comprehensive reference for the OTPInput component, guiding you through its configuration options.
Demos

Screenshot #

Blazor OTPInput Component

Parameters #

Name Type Default Required Description Added Version
AdditionalAttributes Dictionary<string, object>? null Gets or sets additional attributes that will be applied to the component. 1.0.0
Class string? null Gets or sets the CSS class name(s) to apply to the component. 1.0.0
ContainerCssClass string? null Gets or sets CSS classes applied to the element that contains the OTP fields. 4.0.0
ContainerCssStyle string? null Gets or sets inline CSS styles applied to the element that contains the OTP fields. 4.0.0
Id string? null Gets or sets the ID. If not set, a unique ID will be generated. 1.0.0
Length int 6 Gets or sets the number of digit fields rendered for the one-time password. 4.0.0
Style string? null Gets or sets the CSS style string that defines the inline styles for the component. 1.0.0

Methods #

Name Return type Description Added Version
ClearAsync() Task Clears every OTP digit, raises the change callback, and returns focus to the first field. 4.0.0

Events #

Name Return Type Description Added Version
OnOTPChanged EventCallback<string> Fires whenever an OTP digit changes and supplies the current combined value. 4.0.0
OnOTPCompleted EventCallback<string> Fires when every OTP field contains a digit and supplies the completed one-time password. 4.0.0

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.