Components
Forms
Forms are a foundational UI component for collecting and processing user information. They are composed of various interactive elements, such as text inputs, which enable users to enter data in a structured and guided manner.
When to use
Creating a new record
Use when a user needs to input information to create a new item, such as a user profile, a contact, or a new project.
Creating a new record
Use when a user needs to input information to create a new item, such as a user profile, a contact, or a new project.
Creating a new record
Use when a user needs to input information to create a new item, such as a user profile, a contact, or a new project.
Updating existing data
Forms allow users to modify or edit an existing record, like updating a shipping address or changing account settings.
Updating existing data
Forms allow users to modify or edit an existing record, like updating a shipping address or changing account settings.
Updating existing data
Forms allow users to modify or edit an existing record, like updating a shipping address or changing account settings.
Submitting requests or feedback
Use forms for a user to send a message, submit a support ticket, or provide feedback.
Submitting requests or feedback
Use forms for a user to send a message, submit a support ticket, or provide feedback.
Submitting requests or feedback
Use forms for a user to send a message, submit a support ticket, or provide feedback.
Login or authentication
Forms are essential for collecting credentials to authenticate a user.
Login or authentication
Forms are essential for collecting credentials to authenticate a user.
Login or authentication
Forms are essential for collecting credentials to authenticate a user.
Longer processes
For multi-step processes like checkout or onboarding, use a form broken into manageable sections with a progress indicator to guide the user.
Longer processes
For multi-step processes like checkout or onboarding, use a form broken into manageable sections with a progress indicator to guide the user.
Longer processes
For multi-step processes like checkout or onboarding, use a form broken into manageable sections with a progress indicator to guide the user.
When to avoid
Simple actions
Avoid forms for simple actions that can be accomplished with a single button or toggle.
Simple actions
Avoid forms for simple actions that can be accomplished with a single button or toggle.
Simple actions
Avoid forms for simple actions that can be accomplished with a single button or toggle.
Non-interactive content
Do not use form components to display static or read-only information.
Non-interactive content
Do not use form components to display static or read-only information.
Non-interactive content
Do not use form components to display static or read-only information.
Direct manipulation
If the user's task is better served by a drag-and-drop interface or a direct manipulation model, a form may be too rigid.
Direct manipulation
If the user's task is better served by a drag-and-drop interface or a direct manipulation model, a form may be too rigid.
Direct manipulation
If the user's task is better served by a drag-and-drop interface or a direct manipulation model, a form may be too rigid.
Specifications
Alignment
For the sake of consistency and user familiarity, it's best practice to choose a single alignment pattern for forms across your entire application. This means either placing all labels above their corresponding fields or to the left of them.
Vertical (top-aligned label)
Proven to be the most efficient layout. It creates a single, continuous column, significantly reducing the user's cognitive load and the time required for completion.
For mobile devices or smaller screen sizes, aligning the label at the top is strongly recommended due to limited screen real estate. This ensures a clean, single-column layout that is easy to scan on the go.
Horizontal (left-aligned label)
Best used when a form is very long or a slower completion rate is desired (e.g., asking for very sensitive data). It reduces vertical space and creates a Z-shaped reading pattern.
For the sake of consistency and user familiarity, it's best practice to choose a single alignment pattern for forms across your entire application. This means either placing all labels above their corresponding fields or to the left of them.
Vertical (top-aligned label)
Proven to be the most efficient layout. It creates a single, continuous column, significantly reducing the user's cognitive load and the time required for completion.
For mobile devices or smaller screen sizes, aligning the label at the top is strongly recommended due to limited screen real estate. This ensures a clean, single-column layout that is easy to scan on the go.
Horizontal (left-aligned label)
Best used when a form is very long or a slower completion rate is desired (e.g., asking for very sensitive data). It reduces vertical space and creates a Z-shaped reading pattern.
For the sake of consistency and user familiarity, it's best practice to choose a single alignment pattern for forms across your entire application. This means either placing all labels above their corresponding fields or to the left of them.
Vertical (top-aligned label)
Proven to be the most efficient layout. It creates a single, continuous column, significantly reducing the user's cognitive load and the time required for completion.
For mobile devices or smaller screen sizes, aligning the label at the top is strongly recommended due to limited screen real estate. This ensures a clean, single-column layout that is easy to scan on the go.
Horizontal (left-aligned label)
Best used when a form is very long or a slower completion rate is desired (e.g., asking for very sensitive data). It reduces vertical space and creates a Z-shaped reading pattern.
For the sake of consistency and user familiarity, it's best practice to choose a single alignment pattern for forms across your entire application. This means either placing all labels above their corresponding fields or to the left of them.
Vertical (top-aligned label)
Proven to be the most efficient layout. It creates a single, continuous column, significantly reducing the user's cognitive load and the time required for completion.
For mobile devices or smaller screen sizes, aligning the label at the top is strongly recommended due to limited screen real estate. This ensures a clean, single-column layout that is easy to scan on the go.
Horizontal (left-aligned label)
Best used when a form is very long or a slower completion rate is desired (e.g., asking for very sensitive data). It reduces vertical space and creates a Z-shaped reading pattern.
Success & error states
Success
All fields that have been completed with data, and the action button is enabled as a result.
Error
A field with a red border, a red error message, and an accompanying icon to indicate a validation issue. The action button is disabled.
Success
All fields that have been completed with data, and the action button is enabled as a result.
Error
A field with a red border, a red error message, and an accompanying icon to indicate a validation issue. The action button is disabled.
Success
All fields that have been completed with data, and the action button is enabled as a result.
Error
A field with a red border, a red error message, and an accompanying icon to indicate a validation issue. The action button is disabled.
Success
All fields that have been completed with data, and the action button is enabled as a result.
Error
A field with a red border, a red error message, and an accompanying icon to indicate a validation issue. The action button is disabled.
Optional vs. required
Majority required
Label optional fields explicitly. This approach is best suited for forms where most fields are mandatory, as it reduces visual clutter by not marking every required field with an asterisk.
Majority optional
Label required fields explicitly. This approach is best for forms where most fields are optional, as it clearly guides the user to the few mandatory fields they need to complete.
Majority required
Label optional fields explicitly. This approach is best suited for forms where most fields are mandatory, as it reduces visual clutter by not marking every required field with an asterisk.
Majority optional
Label required fields explicitly. This approach is best for forms where most fields are optional, as it clearly guides the user to the few mandatory fields they need to complete.
Majority required
Label optional fields explicitly. This approach is best suited for forms where most fields are mandatory, as it reduces visual clutter by not marking every required field with an asterisk.
Majority optional
Label required fields explicitly. This approach is best for forms where most fields are optional, as it clearly guides the user to the few mandatory fields they need to complete.
Majority required
Label optional fields explicitly. This approach is best suited for forms where most fields are mandatory, as it reduces visual clutter by not marking every required field with an asterisk.
Majority optional
Label required fields explicitly. This approach is best for forms where most fields are optional, as it clearly guides the user to the few mandatory fields they need to complete.
Progressive disclosure
Collapsed
Begins with only the most critical question to help reduce cognitive load by revealing information gradually, based on the guest's initial response. This prevents overwhelming guests with too many questions at once, making the process more efficient.
Full
Additional options are revealed based on the user's selection (e.g., "Yes" to attending). This streamlines the user's flow by presenting information in a logical sequence, ensuring that they interact only with fields relevant to their specific choices.
Collapsed
Begins with only the most critical question to help reduce cognitive load by revealing information gradually, based on the guest's initial response. This prevents overwhelming guests with too many questions at once, making the process more efficient.
Full
Additional options are revealed based on the user's selection (e.g., "Yes" to attending). This streamlines the user's flow by presenting information in a logical sequence, ensuring that they interact only with fields relevant to their specific choices.
Collapsed
Begins with only the most critical question to help reduce cognitive load by revealing information gradually, based on the guest's initial response. This prevents overwhelming guests with too many questions at once, making the process more efficient.
Full
Additional options are revealed based on the user's selection (e.g., "Yes" to attending). This streamlines the user's flow by presenting information in a logical sequence, ensuring that they interact only with fields relevant to their specific choices.
Collapsed
Begins with only the most critical question to help reduce cognitive load by revealing information gradually, based on the guest's initial response. This prevents overwhelming guests with too many questions at once, making the process more efficient.
Full
Additional options are revealed based on the user's selection (e.g., "Yes" to attending). This streamlines the user's flow by presenting information in a logical sequence, ensuring that they interact only with fields relevant to their specific choices.
Read-only
Majority-read-only
The most common use case for read-only forms involves a combination of static data and a few specific editable items. This is useful for records that should not be changed frequently.
All editable (labels)
A less common version where all label values can be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
All editable (inputs)
Another less common version allows all input values to be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
Majority-read-only
The most common use case for read-only forms involves a combination of static data and a few specific editable items. This is useful for records that should not be changed frequently.
All editable (labels)
A less common version where all label values can be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
All editable (inputs)
Another less common version allows all input values to be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
Majority-read-only
The most common use case for read-only forms involves a combination of static data and a few specific editable items. This is useful for records that should not be changed frequently.
All editable (labels)
A less common version where all label values can be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
All editable (inputs)
Another less common version allows all input values to be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
Majority-read-only
The most common use case for read-only forms involves a combination of static data and a few specific editable items. This is useful for records that should not be changed frequently.
All editable (labels)
A less common version where all label values can be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
All editable (inputs)
Another less common version allows all input values to be updated, and the entire component becomes editable when the user clicks the "Edit" action on the form.
Anatomy
1
Title
A clear heading that states the purpose of the form.
2
Label
Should indicate some instructions for selection. If the majority of fields are required in a single form, the "Option" label can be toggled on. If the majority of fields are optional, the "Required asterisks" should instead be toggled on.
3
Input text
The interactive area where the user can enter information.
4
Value
The content or data that has been entered into the input field.
5
Icon
Optional icons can be placed on either the leading or trailing edge to add visual meaning or functionality to the text field.
6
Assistive text
For additional instructions or validation messages, which can be paired with an icon for enhanced visual meaning.
7
Error message
A brief, helpful message that appears below the input field to explain why the user's input is invalid.
8
Action button
A clearly labeled button (e.g., "Submit," "Save") that allows the user to complete the form.
9
Container
The outer shape that visually groups and houses the input field and its associated elements, such as the error message.
Value
Forms
Forms