Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Overview
  • Layout
  • Containers
  • Navigation
  • Display
  • Forms
    • Form controls
    • Form layouts
      • Guidelines
      • Form rows
      • Described form groups
      • Compressed forms
      • Form labels
      • Prepends and appends
      • Form control layouts
    • Form validation
    • Text controls
    • Numeric controls
    • Selection controls
    • Search and filter controls
    • Date and time controls
    • Other controls
  • Tabular content
  • Templates
  • Editors and syntax
  • EUI
  • Forms
  • Form layouts
  • Guidelines

Form layouts guidelines


This page documents patterns for form layout, validation and how best to use various components.

Key Principles

Help users achieve success

Our form components try to be as informative and clear as possible for the user to avoid errors or confusion.

Use labels and descriptions

Use a label (and description if needed) for each form field. All form fields should be considered required unless stated alongside the label.

Provide help text

Show validation parameters in the help text below the input. For example: Spaces and special characters are not allowed.

Validate on blur

Validation should occur on blur from an input field. The submit button should be active by default, then show errors after click. Error messages should be specific to the situation.

Provide transparency

It should be clear to users what they can accomplish in each part of the form.

Layout matters

A well-formatted layout makes it clear to users how to navigate the form. As one field is completed, it should be clear where to go next.

Words matter

Form labels and descriptions are equally important as layout and should be treated with just as much care. The text should be specific, concise, and easy to scan.

Maintain a standard layout

Keep the form divided into two columns, with the descriptions on one side and form fields on the other.

Proper field alignment

Do: To make groupings clearer and keep the user's eye in one path, it's better to keep inputs in a single column. If multiple fields are needed, they should still remain within the column.

Incorrect field alignment

Don't: Avoid nesting form rows. It creates an uneven path for the user's eye to travel down the form.

Divide the form into sections

As a form grows longer, it's best to divide the form into sections. This helps the user quickly scan the form and provides visual breaks between multiple input fields.

Proper use of dividers

Do: Adding visual indicators can help clearly define the sections of the form.

Incorrect use of panels

Don't: Using panels within panels creates too much visual noise and can make it confusing where sections begin and end.

Proper use of spacing

Do: Add more spacing between form groups than fields within the group to better define the grouping.

incorrect use of spacing

Don't: Avoid using the same spacing between groups and individual fields. It is harder for the user to scan and understand the sections of the form.

Described groups

An EuiDescribedFormGroup provides an additional heading along with description text for a single input or set of input fields.

When to use it

This component is not intended for every type of form, but typically works best in the following scenarios.

  1. Forms with lengthy descriptions per input
    If a longer description is needed, use an EuiDescribedFormGroup to divide the form into a column for descriptions and a column for form fields. This is so there is space for descriptions to aid new users, but keeps the form fields in a column, so frequent users can still quickly navigate the form. Try to limit the description to three sentences or less.

  2. Forms with multiple inputs falling under a single heading
    If multiple sub-steps are needed, grouping them together using an EuiDescribedFormGroup helps show they are all still related.

  3. Forms with complex nested options
    A described group is useful when there are parts of the form that can be hidden and shown by the user. The toggle to hide and show the row should be beneath the description and the following form fields should be in the right column with the other form fields.

Form copy

Labels

Avoid long labels, but don't sacrifice clarity. If needed, put additional information in help text and tooltips.

Use the `major.minor` format. You can use wildcards `*` to span over multiple versions.

Do: Say what the field is in the label. Use help text for additional information.

Don't: Put everything in the label. It's hard to scan.

Hint text

Place hints and instructions outside a text field so it is always visible to the user. Keep the hint text short, maximum two sentences long. Use hint text to:

  • Explain why you are asking a certain question: "We will only email you if there is a problem with your order."
  • Provide clarifying details on what to type: "Enter the full 32-character ID."
  • Tell the user where to find the information you're asking for: "Find the Elasticsearch cluster ID on the main administration page of your deployment."
Use shorthand notation, such as 30s, 10m, or 1h.

Do: Help users make the right decision by clarifying what goes inside a field.

This is the name that will be visible to other users.

Do: Use complete sentences and ending punctuation.

Placeholder text

Use the placeholder property to describe the expected value of the input or to provide a useful example.

Include the international call prefix.

Do: Provide a simple example that highlights the expected syntax or value.

Include the port number.

Don't: Start with `for example`, or `e.g.`.

Add placeholder text in addition to field labels and help text, not as a replacement. Omit it if it doesn't add value for users. And keep it short.

Enter a valid IP address.

Do: Place info essential to completing the form outside the field so that it is always visible.

Enter CIDR or IP address. For example, `192.168.132.6/22`.

Don't: Use text that adds no value, such as “Type here”.

When space is limited and the UI is very simple, you can use field labels as placeholder text. This must stay an exception.

Don't: If space allows it, prefer following the rule described earlier with labels outside of the fields.

In a search bar, be specific about what users can enter.

Do: Give users a hint at things they might want to search for. State the action the user performs (find, search) instead of the field functionality (jump to).

Don't: Use an ellipsis.

Edit this page

Previous
Guidelines
Next
Form rows
  • Key Principles
    • Help users achieve success
    • Provide transparency
    • Maintain a standard layout
    • Divide the form into sections
  • Described groups
    • When to use it
  • Form copy
    • Labels
    • Hint text
    • Placeholder text
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic