InputOtp is used with the v-model property for two-way value binding. The number of characters is defined with the length option, which is set to 4 by default.
InputOtp can be used as a controlled component with v-model.
Enable the mask option to hide the values in the input fields.
When integerOnly is present, only integers can be accepted as input.
Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
InputOtp provides small and large sizes as alternatives to the base.
When disabled is present, the component becomes non-interactive.
Define a template with your own UI elements with bindings to the provided events and attributes to replace the default design.
A sample UI implementation with templating and additional elements.
Please enter the code sent to your phone.
InputOtp integrates seamlessly with the PrimeVue Forms library.
Input OTP uses a set of InputText components, refer to the InputText component for more information about the screen reader support.
| Key | Function |
|---|---|
| tab | Moves focus to the input otp. |
| right arrow | Moves focus to the next input element. |
| left arrow | Moves focus to the previous input element. |
| backspace | Deletes the input and moves focus to the previous input element. |