Form

You might say

Build a sign-up page where people fill in their information and submit it.

Collect several fields and submit them as one taskA form organizes multiple inputs into a task such as creating an account or placing an order. It needs clear labels, validation, error placement, submission state, and a final result so people know what to fix and whether their data was saved.
Know first
✕ Enter a valid email address
FormFieldset

A Form collects and submits a complete task. A fieldset only groups related fields inside a form and commonly uses a legend to name the group.

When to use it

  • Account registration
    oil-oil••••••••
    Sign in
  • Checkout
    NameAlex Chen
    Emailyou@example.com
  • Create or edit a record
    Emailoil-oil@abc
    ✕ Invalid email format
  • Any task that submits several related fields
    NameAlex Chen
    CityShenzhen
    Notifications
    Save

When NOT to use it

  • Ask for information that is not needed for the task
    Search form
    Enter keywords…Submit
    One search field doesn’t need extra form structure
  • Clear every field after one error
    Too many fields on one page make the form burdensome
  • Show only a generic error at the top
    Password123
    Submission failed: password must be at least 8 charactersThe rule is hidden until submission fails
  • Allow repeated submission while the first request is running
    Versionv2.4.0
    Authoroil-oil
    Putting read-only information in fields makes people think they can edit it
Anatomy
✕ Enter a valid email address
A complete unit of a field: label + control + error
Tells users what to enter
The control where someone enters or chooses a value
A nearby message that explains how to fix a validation error
Submit or cancel actions; make the primary action most prominent
Variants
Horizontal
When there are fewer fields and the page is wider, place the label on the left
Vertical
When there are many fields or the page is narrow, place the label above the input box
Inline
When filter controls and the search action should stay on one row
Validation
✕ Enter a valid email address
When validation fails, explain the error next to the affected field.
Typical use cases
Registration
LoginRegister
Checkout
Project settings
New project
Contact form
Order #20260721-018Completed¥ 329
Order #20260721-017In progress¥ 89
Further reading