Forms

Design forms that meet AA accessibility standards and work with assistive technologies.

Spacing

The correct spacing indicates context to the user. The size of spacing varies to clearly group sections or elements together.

Forms should have consistent spacing 8px between each element needed to make up an input, label and helper/error copy.

Stacks

React native has several <Stack> components specifically for forms. These should be used to maintain consistency across the platform.

Element Spacing

Form Element Spacing

Form Element Spacing

An 8px spacing between the label and input field or helper text.

Field Group Spacing

A field group is a combination of two or more elements, such as a label and an input. There should be a 16px spacing between field groups.

Field Group Spacing

Field Group Spacing

A 16px spacing between field groups.

Fieldset Spacing

A fieldset is a combination of two or more field groups.

Use space and headings to break long forms into fieldsets. The spacing value could increase to 32px to define each fieldset clearly.

Fieldset Spacing

Fieldset Spacing

Fieldsets

When asking the user to input content in a specific structure, you can use multiple input fields (fieldsets). An example of this is memorable dates, such as the date of birth. We should use three separate text input fields and a legend heading.

Each product's requirements will vary, but grouped inputs should:

  • Allow the user to copy/paste data into the field group, not just a single input
  • Have a single error message across the group
  • Be able to navigate between with keyboard controls
An example of 'Date of Birth' fieldset

An example of 'Date of Birth' fieldset

Radio buttons and Checkboxes

Spacing values for radio buttons and checkboxes

Spacing values for radio buttons and checkboxes

Fieldsets & Buttons

There should be a double spacing of 32px between the last field and the button group across all breakpoints.

Fieldsets and button spacing

Fieldsets and button spacing

Validation

There should be a space of 16px between the error message and the next group of related fields.

Validation Spacing

Validation Spacing