Forms

Forms are used to accept the user's input. They can be displayed in many different ways: input- or select-fields, check boxes or radio buttons.

They are an important element in online shops, so it is even more essential that they are designed to be user-friendly. They serve to get information and guide the user through each task with minimal effort.


Possible use cases#

  • Login and registration (check-in, check-out)
  • Transaction (orders, payment)
  • Contact (support, callbacks, requests)
  • Data collection (lotteries, newsletters, surveys)
  • Contribution (blogs, comments, posts)

Recommendations#

  • Always try to keep the form and the text as short as possible!
    A short form helps the user to get a fast overview and he recognizes easy what is required.
  • If you use an input field as a single row or with a fixed height, demonstrate an overflow text (clipping) by an ellipse.
  • If there is more than one option but only one can be selected, use a radio button instead of a checkbox.
  • The open list of options in a select-field is always the native list of the browser.

Overall styling#

  • Text-style is basic.
  • The line-height is set to default.
  • Corners have a 2px radius.
  • Borders have a 1px thickness.
  • Hover or focus states are always shown with a border in brand-primary-base.
  • Icon size is 24x24px.
  • Important! The colors of the icons follow the basic rules for icons.
  • The background color is basic-white, except for the disabled state displayed in gray-background.

Checkbox#

  • Choose a checkbox if the user must make one or more decisions about a particular element.
  • Each checkbox in a group represents a separate and independent choice.
  • Checked checkboxes use an embedded element as icon which isn't included in the icon sprite.
 StatesAttributesPreview
Default text-color: gray-darker
border: gray-base
 checkbox: default
 Hover / Focustext-color: brand-primary-base
border: brand-primary-base
checkbox: hover-focus
 Disabledtext-color: gray-base
border: gray-light
checkbox: disabled
Errortext-color: danger-base
border: danger-base
checkbox: error
Checked: Default text-color: brand-primary-base
border: gray-base
icon-color: brand-primary-base
 checkbox: checked-default
Checked: Hover / Focustext-color: brand-primary-base
border: brand-primary-base
icon-color: brand-primary-base
checkbox: checked-hover-focus
Checked: Disabledtext-color: gray-base
border: gray-light
icon-color: gray-light
checkbox: checked-disabled
Checked: Errortext-color: danger-base
border: danger-base
icon-color: danger-base
checkbox: checked-error

Radio button#

  • Choose a radio button if the user needs to select a single option from multiple options, or if you want the user to carefully consider the options and see all available ones.
  • Selected radio buttons use our "bullet.svg" as icon.
 StatesAttributesPreview
Default text-color: gray-darker
border: gray-base
 radiobutton: default
 Hover / Focustext-color: brand-primary-base
border: brand-primary-base
radiobutton: hover-focus
 Disabledtext-color: gray-base
border: gray-light
radiobutton: disabled
Errortext-color: danger-base
border: danger-base
radiobutton: error
Selected: Default text-color: brand-primary-base
border: gray-base
icon-color: brand-primary-base
 radiobutton: selected-default
 Selected: Hover / Focustext-color: brand-primary-base
border: brand-primary-base
icon-color: brand-primary-base
radiobutton: selected-hover-focus
 Selected: Disabledtext-color: gray-base
border: gray-light
icon-color: gray-light
radiobutton: selected-disabled
Selected: Errortext-color: danger-base
border: danger-base
icon-color: danger-base
radiobutton: selected-error

Input field#

  • Use input fields in the various states to show the user that he can enter data.
    They typically appear in forms and dialogs.
 StatesAttributesPreview
 Placeholder text-color: gray-base
border: gray-base
 input-field: placeholder
 Placeholder-Hovertext-color: gray-base
border: brand-primary-base
input-field: placeholder-hover
Focus (text input)text-color: gray-darker
border: brand-primary-base
input-field: focus (text input) 
 Defaulttext-color: brand-primary-base
border: gray-base
input-field: default 
Default-Hovertext-color: brand-primary-base
border: brand-primary-base
input-field: default-hover
 Disabledtext-color: gray-base
border: gray-light
input-field: disabled
Errortext-color: danger-base
border: danger-base
input-field: error
Successtext-color: brand-primary-base
border: brand-primary-base
input-field: success

Select field#

  • The select field is part of forms and opens a list of options.
  • The consistent appearance of a select field compared to other form elements (input field, checkbox, etc.) is important and also refers to the different states.
  • Select fields use our "arrow-down.svg" as icon.
 StatesAttributesPreview
Default text-color: brand-primary-base
border: gray-base
icon-color: gray-darker
 select-field: default
Hover / Focustext-color: brand-primary-base
border: brand-primary-base
icon-color: gray-darker
select-field: hover-focus
 Disabledtext-color: gray-base
border: gray-light
icon-color: gray-base
select-field: disabled 
Errortext-color: danger-base
border: danger-base
icon-color: gray-darker
select-field: error 
Successtext-color: brand-primary-base
border: brand-primary-base
icon-color: gray-darker
select-field: success

Text area#

  • Use text area when there is a need for collecting long responses. They are typically used when users are required to leave feedback.
  • Text area element always contains a placeholder text. That way users are encouraged to interact with it.
  • Container has a fixed height and becomes scrollable if there are more than four lines of text. Once it is scrollable, a scroll bar appears as an indicator (scroll bar style and behavior depend on the browser).
BehaviorPreview
Text overflow is hidden inside the container. When the text is scrolled, it is cut at the top and bottom outline of the container. input-field: placeholder
 StatesAttributesPreview
 Placeholder text-color: gray-base
border: gray-base
 input-field: placeholder
 Placeholder-Hovertext-color: gray-base
border: brand-primary-base
input-field: placeholder-hover
Focus (text input)text-color: gray-darker
border: brand-primary-base
input-field: focus (text input) 
 Defaulttext-color: brand-primary-base
border: gray-base
input-field: default 
Default-Hovertext-color: brand-primary-base
border: brand-primary-base
input-field: default-hover
 Disabledtext-color: gray-base
border: gray-light
input-field: disabled
Errortext-color: danger-base
border: danger-base
input-field: error

Labels#

  • Labels are part of the text area, input field and select field.
  • They use basic-bold as label- and basic as optional-text.
  • Give each form element a unique label.
  • The (optional) part is fixed and is used for labels where user input isn't mandatory.
 StatesAttributesPreviewCombinations
Defaulttext-color: gray-darkerlabel: defaultlabel: default

Spacing & measurements#

TypeAttributesPreview
Horizontal8px margin between radiobutton (or checkbox) and optional text
8px margin between label and optional text
16px padding between text (or icon) and container
16px padding between text and container
spacing radiobutton
spacing checkbox
spacing input field
spacing freetextarea
VerticalInput field:
Text is always centered to container height.

Text area:
LG: 11px
MD-XS: 9px
spacing centered-text
spacing freetextarea
HeightInput field:
LG: 48px
MD-XS: 40px
Width depends on device and usage.

Text area:
LG: 135px
MD-XS: 120px
measurements: height
measurements: height
measurements: height
Distance8px between form and label
32px between form blocks
spacing: forms

Our workflow in Sketch#

  • Use the "Overrides"-function to enter text.
  • Fill in "space" to show an empty input-or select field.
  • Demonstrate the different states by changing the predefined layer-style.
  • If you don't want to show an icon, just select "Default" in the "Overrides"-function from the checkbox layer-styles.
  • Pick the label symbol out of the library.

Change log#

Added#

  • Sketch, Doc: "Form" | Added text area component for long text input

Changed#

  • Sketch: "Form" | Adjusted input and select fields to new grid settings

Changed#

  • Sketch: "Form" | Adapted component input field and form select field to new grid settings

Changed#

  • Doc: "Form" | Clean up the documentation for the right structure and sentence case

Changed#

  • "Form" | Changed symbols: with layer-styles settings (checkbox, input- & select-field)
  • "Form" | Changed symbols: with radius symbol

Changed#

  • "Form" | Changed description: checkbox

Fixed#

  • "Form" | Fixed description: disabled icon-color from "gray-darker" to "gray-base"

Changed#

  • "Form" | Moved symbols to sketch web kit

Fixed#

  • "Form" | Fixed symbol: MD-XS input-field/default-hover icon from "arrow-down" to "placeholder"

4.3.0 Core & 4.3.0 Web - 2020-02-27#

Added#

  • "Form" | Added description: color of arrow in select-field
  • "Form" | Added description: text-style and usage of labels

Changed#

  • "Form" | Changed description: label

Fixed#

  • "Form" | Fixed symbol: color of arrow-down of MD-XS select-field/disabled from "gray-light" to "gray-darker"

Removed#

  • "Form" | Removed symbol and description: "label/disabled" of input- and select-field

4.2.0 Core & 4.2.0 Web - 2020-01-16#

Added#

  • "Form" | Added symbols and description: input-fields, select-fields (MD-XS)

Changed#

  • "Form" | Changed symbols to new smart layout of Sketch

Fixed#

  • "Form" | Fixed symbols of checkbox, radio button, input- and select-field: color of disabled state from "gray-light" to "gray-base"

3.1.0 Core & 3.1.0 Kit - 2019-05-24#

Fixed#

  • "Form" | Fixed symbols of radio-button: resizing options for "success"-state
  • “Form" | Fixed symbols of select-field: padding of text frame to "16px"