Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Optional versus required fields section #2528

Merged
merged 2 commits into from
Sep 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions src/pages/components/form/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,29 @@ characters."_

### Optional versus required fields

All fields in a form are assumed required, with optional fields being tagged as
so. It is recommended that an instruction precedes the form stating either "All
fields are required" or "All fields are required unless marked optional".
When designing your form, consider the purpose and the use case, and note if the majority of the fields are **required** or **optional**. 

- If the majority of the fields are required, mark **only** the optional fields with (optional). 
- If the majority of the fields are optional, mark **only** the required fields  with (required). 

Using the appropriate pattern based on the use case will reduce visual noise and clutter; helping your users to more quickly and accurately complete the form. It will also ensure consistency through and across products. 

If you choose to mark only optional form fields, it is recommended that an instruction precedes the form stating either “All fields are required” or “All fields are required unless marked optional”. 

<Row>
<Column colLg={8}>

![Example of a short user sign-up form using the Optional pattern](https://user-images.githubusercontent.com/48838320/131397684-0882cf1e-90b8-4029-ac26-bc111329f323.png)
Example of a short user sign-up form using the Optional pattern

</Column>
</Row>

<Row>
<Column colLg={8}>

![optional fields in a form](images/form-usage-5.png)
![Example of product configuration properties using the Required pattern](https://user-images.githubusercontent.com/48838320/131397758-015ea0ea-e3ba-4a67-947b-e4215235e2b5.png)
Example of product configuration properties using the Required pattern

</Column>
</Row>
Expand Down