Authenticator

Also known as: OTP input, 2FA input

Resources

Properties

PropertyValuesDefault
Size VariantSm | Md | Lg | XlMd
State VariantDefault | Hover | Focus | Active | Error | DisabledDefault
Has label Booleantrue | falsetrue
Label TextstringLabel
Value Textstring9
Has helper Booleantrue | falsetrue

When to use

When two-factor authentication is required for the user to get access to the application, or when performing sensitive actions.
Confirming user email address or phone number during onboarding.
Automatically make the next field active after entering a value.
Provide real-time feedback on the field.

If the system supports a more seamless authentication method, such as biometric authentication.

Behaviour

Authenticator (and all other forms and selection controls) express states. States indicate current condition of the component to someone interacting with it. Using states ensure clear user feedback, highlighting possible actions or barriers. We have included most common states:

StateContext
DefaultStatus of the component before the interaction. Also referred to as ‘resting’.
HoverWhen the user moves their cursor over the component, but is not taking the action. Slight visual change can indicate interactivity of the component.
FocusWhen user selects the component via keyboard navigation, but has not yet taken action on it.
ActiveState that communicates that the user has taken action on the component.
ErrorUsed when an invalid action occurs. Component may appear red or display helper, signaling an issue that needs resolution.
DisabledA non-interactive state where the component appears faded or grayed out. It indicates that the action is unavailable at the moment.

Size

Dimensions of the authenticator are tied to the global scale tokens. This ensures that the components, especially forms, with similar size settings remain consistent across the interface. scale tokens also provides more granular control over dimensional settings.

scale.css
--scale-height-<size>
--scale-width-<size>
--scale-padding-<size>
--scale-gap-<size>
--scale-radius-<size>
--scale-text-size-<size>
--scale-text-height-<size>

Length

The length of the authenticator is flexible. Depending on the type of code, slot amount can be adjusted between 4 and 6.

Helper component

Helper is a nested component and can optionally be shown below the authenticator. Use helper text if providing additional context about the form item (error message or hint). Keep the message concise and clear, optionally show an icon to support the message.

PropertyValuesDefault
Error Booleantrue | falsefalse
Has icon Booleantrue | falsetrue
Icon InstanceSwapIconinfo
Label TextstringHelper