Form

Forms are component patterns that allow people to enter a set of data to be used by the platform for a specific task. They are built using text inputs, select radios, checkboxes, buttons, and text blocks with descriptions or instructions. A form can be used in a page or in a modal.

Anatomy

Forms can consist of four types of elements depending on the type of data to be collected from the user.

form anatomy
  1. Close icon button allows the user to close the form when it is in a modal format.
  2. Title sets the topic for the form. This is optional, depending on the purpose of the form.
  3. Body gives context on why and what information in the form is needed. This is optional, depending on the purpose of the form.
  4. Form elements represent the content of the form and the data needed from the user. Text inputs, selects, radios, and checkboxes can be used.
  5. CTA enforces the desired user action. Users can click the CTA to submit the entered information.

Usage

When to Use

Use a form to gather specific information, when users need to enter data to execute an action.

When Not to Use

Don’t use a form when there is no need to get data from the user and an action can be executed by selecting an option. Use another section with a CTA instead (a modal, card, thrasher, or single input , depending on the action).

Variants

There are two variations of the form based on their purpose and implementation.

Form modal variant
Variation
Purpose
Close Icon Button
Form elements
CTA

Modal form

Use a form as a modal when you have a short form or when the page is full of content and CTAs, and you want the user to strictly focus on one form.

With close icon button

With form elements (1 to 6)

With a primary CTA

Fixed form

Use this type of form when the form is closely related to a page section or when you have a longer form.

Without close icon button

With form elements (2 to more than 6)

With a primary CTA

Types

Modal Form

A form can be used as a modal for specific cases. This type of forms will have two widths depending on the screen size: compact and extended.

Compact: MD and SM breakpoints

Modal form for compact sizes: MD and SM breakpoints

Extended: LG and XL breakpoints

Modal form for extended sizes: LG and XL breakpoints

Fixed Form

A form can be fixed on a page as part of a section: hero, container section, or page. This type of form will adjust its size depending on the section and view-port.

Fixed form

Container

Spacing

Ensure that proper space is given between each form element. Forms are mainly built using inputs, select elements, text blocks, and background. We maintain consistent spacing between the input-select elements and larger spacing between them and the form instructions. The form elements will be displayed in a single column in the container. The standard vertical distance between each input is 24px.

Modal form
Modal form
Fixed Form
Fixed Form

Hierarchy

A proper hierarchy must be ensured for the elements that compose the form. Forms are composed of several inputs and actionable elements, which is why it's necessary to define the level of importance of each data input, show the relationship between them, and present them in a logical way.

The title, with the highest level of importance, needs to give a clear and short idea of the topic of the form. If extra context or instructions are needed, add body copy below the title, with a secondary level of importance. Form elements should be placed below the title and the body text, using clear labels and listed in a logic order for the user. The CTA should be a primary button (with a label) placed at the bottom of the form.

hierarchy in forms

Alignment

Ensure that proper space is given between each element. All elements will be vertical left-aligned and take the width of the container.

Alignment of form elements inside a form container
how to organize form elements the right way

Do organize the form elements in a single column.

how not to organize form elements

Don’t organize the elements in more than one column.

where to place the CTA on a form

Do left-align the primary button at the bottom of the form.

where not to place the CTA on a form

Don’t right-align the primary button.

Sizing

Forms have a minimum height of 305px when they use a title and body and a minimum height of 196px when they don’t. Depending on the number and type of form elements, the form will grow taller, and ultimately become scrollable, but it should never be less than 196px in height.

form types minimum heights

Behavior

Scrolling

When there are more inputs than the ones that fit inside the visible space of the container, the content becomes scrollable (with a vertical scroll).

Default - No Scrolling

How the forms should behave on a default view when being a long scrollable form

Scrolled

How the forms should behave when scrolling when being a long scrollable form

Overlay

Modal forms will pop up over the page where prompted over an overlay in Neutral 15 with a transparency of 50% for the light theme, and Neutral 80 with a transparency of 50% for the dark theme.

Overlay color when having a modal form on light theme
Overlay for light theme
Overlay color when having a modal form on dark theme
Overlay for dark theme

Themes

Form on dark theme
Dark
Form on mid theme
Mid
Form on light theme
Light