Input Types in .NET MAUI OTP Input

14 Mar 20251 minute to read

Types

This section explains the various types of OTP (One-Time Password) input component, explaining their default behaviors and appropriate use cases.

Number type

The Type property can be set to Number, prompting the input to handle numeric-only codes. This is ideal for scenarios demanding numeric OTP’s. By default, the Type property is set to Number.

<otpInput:SfOtpInput Value="1234" Type="Number" />
SfOtpInput otpInput = new SfOtpInput()
{
    Value = "1234",
    Type = OtpInputType.Number
};

Number Image for OTP Input

Text type

You can set the Type property to Text for inputs that may include both letters and numbers, suitable for alphanumeric OTP’s.

<otpInput:SfOtpInput Value="e3c7" Type="Text" />
SfOtpInput otpInput = new SfOtpInput()
{
    Value = "e3c7",
    Type = OtpInputType.Text
};

Text Image for OTP Input

Password type

You can set the [Type]https://help.syncfusion.com/cr/maui-toolkit/Syncfusion.Maui.Toolkit.OtpInput.SfOtpInput.html#Syncfusion_Maui_Toolkit_OtpInput_SfOtpInput_Type property to Password to use this input type as password in the OTP Input.

<otpInput:SfOtpInput Value="e3c7" Type="Password" />
SfOtpInput otpInput = new SfOtpInput()
{
    Value = "e3c7",
    Type = OtpInputType.Password
};

Password Image for OTP Input