PIN Input
Overview
The PIN Input component allows users to enter a secure code, typically for authentication or verification purposes. It consists of multiple input fields representing each digit of the PIN, with clear feedback for each entry to maintain usability and security.
Live demo
Usage
Do
Use the PIN Input for fixed-length numeric or alphanumeric codes (e.g., 4 or 6 characters) required for secure workflows, such as authentication or account recovery.
Provide clear visual feedback as users enter each character, using styles like masking, numbers, or letters, depending on the context and security requirements.
Automatically move focus to the next input field as the user types, ensuring a seamless interaction.
Allow users to navigate backwards to correct errors using the backspace key.
Don't
Avoid using the PIN Input for variable-length inputs; use a standard text field instead.
Do not compromise security by displaying sensitive codes unless required by the context.
Avoid designs that restrict accessibility, such as insufficient focus indicators or non-standard keyboard behaviour.
Placement
- Place the PIN Input prominently in workflows requiring secure code entry, such as login, multi-factor authentication, or account verification screens.
- Ensure adequate spacing between input fields for clarity and ease of use, especially on touch devices.
Content
Labels
PIN Input fields should have labels. A field without a label is ambiguous and not accessible.
Follow capitalisation rules. Labels should be in sentence case.
Helper text
Optional helper text can provide additional guidance for users.
Use helper text to show hints, formatting and requirements.
Write error text that shows a solution.
Don’t use helper text to simply restate the same information in the label or if it isn’t relevant to the specific field.
Use complete sentences that end with a full stop, not an exclamation point.
Placeholder text
Don’t use placeholder text to provide essential information, labels or instructions. Once a value is entered, placeholder text is no longer viewable, which makes it not accessible.
Sizes
PIN Inputs come in three different sizes: small, medium, and large. Medium is the default and the most frequently used option.
Medium
Small
Large
States and interactions
The Text Field should change its appearance based on its state to provide feedback to users.
Enabled
Hover
Error
Error focus
Focus
Success
Success focus
Disabled
Read-only
Disabled PIN Inputs
Due to usability and accessibility issues that arise from using disabled and read-only fields, we suggest considering alternative design patterns. This includes using plain text when possible or validating on submit and guiding users directly to errors with sensible error messages.
Accessibility
Clearly label PIN Inputs for user understanding.
Set appropriate keyboard types based on expected input.
Enable secure text entry for sensitive information.
Implement input validation for expected formats.
Ensure PIN Inputs are easily navigable, fillable, and submittable using only the keyboard.
iOS guidance
Along with the guidance above, there is some iOS specific guidance for this component.
Ensure that the Text Field is accessible to users with disabilities. Set appropriate accessibility labels and hints to assist users relying on VoiceOver.