InputOtp

Input Otp is used to enter one time passwords.

Two-way value binding is defined using ngModel. The number of characters is defined with the length property, which is set to 4 by default.

Two-way value binding is defined using ngModel. The number of characters is defined with the length property, which is set to 4 by default.

basic-demo

Enable the mask option to hide the values in the input fields.

mask-demo

When integerOnly is present, only integers can be accepted as input.

integer-only-demo

InputOtp provides small and large sizes as alternatives to the base.

sizes-demo

Define a template with your own UI elements with bindings to the provided events and attributes to replace the default design.

template-demo
template-driven-forms-demo

InputOtp can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.

reactive-forms-demo

A sample UI implementation with templating and additional elements.

Authenticate Your Account

Please enter the code sent to your phone.

sample-demo

Screen Reader

Input OTP uses a set of InputText components, refer to the InputText component for more information about the screen reader support.

Keyboard Support

KeyFunction
tabMoves focus to the input otp.
right arrowMoves focus to the next input element.
left arrowMoves focus to the previous input element.
backspaceDeletes the input and moves focus to the previous input element.
ON THIS PAGE
Figma UI Kit
The official Figma UI Kit for Prime UI libraries, the essential resource for designing with PrimeOne components.
Learn More