# Input-OTP Input - OTP component consists of multiple input fields designed for entering a one-time password. It automatically advances focus between fields and provides clear feedback for a secure and seamless verification experience. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-input-otp--introduction ## Variants documented in Storybook - InputStates: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-input-otp--inputstates - FeedbackStates: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-input-otp--feedbackstates ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Input-OTP. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Feedback States — Feedback States HTML: ```html
Input - OTP component consists of multiple input fields designed for entering a one-time password. It automatically advances focus between fields and provides clear feedback for a secure and seamless verification experience.
Source-backed examples covering standard OTP inputs.
Quickly copy source-backed utility classes for OTP structure and state patterns.
|
Base OTP container
ux4g-otp
|
|
OTP label
ux4g-otp-label
|
|
OTP inputs group
ux4g-otp-group
|
|
Hidden source input
ux4g-otp-source
|
|
Metadata container
ux4g-otp-meta
|
|
Status indicator
ux4g-otp-status
|
|
Resend button
ux4g-otp-resend
|
|
Success state wrapper
ux4g-otp-success
|
|
Error state wrapper
ux4g-otp-error
|
|
Locked out wrapper
ux4g-otp-locked
|
Input - OTP component consists of multiple input fields designed for entering a one-time password. It automatically advances focus between fields and provides clear feedback for a secure and seamless verification experience.
Source-backed examples covering standard OTP inputs.
Quickly copy source-backed utility classes for OTP structure and state patterns.
|
Base OTP container
ux4g-otp
|
|
OTP label
ux4g-otp-label
|
|
OTP inputs group
ux4g-otp-group
|
|
Hidden source input
ux4g-otp-source
|
|
Metadata container
ux4g-otp-meta
|
|
Status indicator
ux4g-otp-status
|
|
Resend button
ux4g-otp-resend
|
|
Success state wrapper
ux4g-otp-success
|
|
Error state wrapper
ux4g-otp-error
|
|
Locked out wrapper
ux4g-otp-locked
|
Input - OTP component consists of multiple input fields designed for entering a one-time password. It automatically advances focus between fields and provides clear feedback for a secure and seamless verification experience.
Source-backed examples covering standard OTP inputs.
Quickly copy source-backed utility classes for OTP structure and state patterns.
|
Base OTP container
ux4g-otp
|
|
OTP label
ux4g-otp-label
|
|
OTP inputs group
ux4g-otp-group
|
|
Hidden source input
ux4g-otp-source
|
|
Metadata container
ux4g-otp-meta
|
|
Status indicator
ux4g-otp-status
|
|
Resend button
ux4g-otp-resend
|
|
Success state wrapper
ux4g-otp-success
|
|
Error state wrapper
ux4g-otp-error
|
|
Locked out wrapper
ux4g-otp-locked
|