Component: Forms

Summary

Forms are one of the most critical elements of digital experiences, enabling users to submit information, complete transactions, and interact with services.

Well-designed forms should be intuitive, accessible, and efficient to reduce user frustration and improve completion rates.

What Are Forms?

Forms are structured fields that allow users to input and submit information. They are commonly used for tasks such as sign-ups, logins, surveys, and applications. A well-structured form guides users smoothly through the process while minimizing errors.

Examples of Forms

  • Contact Forms: Collect user inquiries, feedback, or support requests.

  • Was This Helpful Forms: Government service applications or job applications.

  • Survey Forms: Gather feedback or research data.

Heading
Was This Helpful Heading
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Feedback Heading

Lead body

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Usability Concerns to Consider

  • Cognitive Load: Avoid overwhelming users with too many fields.
  • Error Prevention: Use inline validation and clear instructions.

  • Mobile Optimization: Ensure forms are easy to use on smaller screens.

  • Accessibility: Support keyboard navigation and screen readers.

When to Use & When to Avoid

When to Use

  • When collecting structured information from users.

  • For transactions, sign-ups, or applications requiring user input.

  • When gathering feedback or data through surveys.

When to Avoid

  • When alternative methods (e.g., chatbots or calls) are more efficient.

  • If the information can be auto-filled from existing user data.

UX Best Practices for Form Design

Minimize the Number of Fields

Less is more: Limit the number of fields to only what’s necessary. Each additional field increases cognitive load and can frustrate users.

Example: Instead of asking for full addresses on a contact form, request just an email and phone number.

Use Clear Labels and Instructions

Ensure every field has a descriptive label that tells users what information is required. If further explanation is needed, use placeholder text or tooltips.

Example: Instead of labeling a field "Name," specify "First Name" and "Last Name" separately if needed.

Input Validation and Error Handling

Provide real-time validation as users complete the form, and make sure error messages are clear and actionable. Users should know what went wrong and how to fix it.

Example: If a password doesn’t meet complexity requirements, specify exactly what is missing, like "Your password must include at least one number.

Use Inline Validation

Inline validation helps reduce frustration by helping users fix errors immediately.  By choosing the appropriate field, automatic validation messages should appear.  For example, if an email address is needed, the field form type chosen should be an email and not an open text field.  Both options will allow for an email address provided, but only the email address field type will validate for proper input of the email.  

Example: Show “Valid email” or “Invalid email format” as soon as the email field is filled out.

Logical Flow and Grouping

Group related information together and arrange fields in a logical order that mirrors the user’s mental model. This makes forms easier to follow.

Example: Group "Billing Address" and "Shipping Address" fields together when checking out on an e-commerce site.

Mobile Optimization

Our design system considers optimization of forms for mobile users by providing mobile-friendly tap targets and using mobile-specific keyboards (like numeric pads for phone numbers).

Progress Indicators for Multi-Step Forms

For longer forms (such as application processes), show users where they are in the process with a progress indicator to reduce anxiety and encourage them to complete it.

Example: An application form that shows “Step 2 of 3: Application” helps users feel they are making progress.

Accessible Design

Ensure forms are accessible to all users, including those with disabilities. Use proper ARIA labels, ensure contrast is high enough for readability, and make forms navigable via keyboard.

Example: Use descriptive alt text for any form icons and ensure form fields can be navigated without a mouse.

Things to Consider

  • Privacy & Security: Ensure user data is protected with encryption and minimal data collection. 

  • Testing: Continuously test forms with real users to identify pain points.

Resources

Learn More

For best practices for forms, visit NNg: Form Design Quick Fix.

For Developers

You can visit Storybook for Inherited CSS Variables and Twig Variables for the form component.