Navigieren auf digital.sbb.ch

Autocompletion

1. What does the component do?

It supports the user when entering suggestions.

2. When should the component be used?

  • When an entry field can have lots of pre-defined values.
  • As an aid for previewing search results/fields.

3. Rules

  • Autocompletion always has a label.
  • Optional entries include the text ‘(optional)’ behind the label text. The text ‘(optional)’ can be abbreviated as ‘(opt.)’ in short fields.
  • A question mark in the circle can also be shown – in addition to the label – for detailed explanations. A tooltip opens if this question mark is clicked on.
  • During entry, suggestions appear directly (usually after three symbols but they can be modified on a project-specific basis).
  • The entries listed can be scrolled through using the arrow keys and accepted with Enter.
  • A maximum of ten suggestions are shown.
  • The autocompletion selection closes when an element is selected.

4. Variants and statuses

The component has the following statuses:

  • Default
  • Hover

4.1 Standard

Image of the autocompletion component in the standard variant

Design specification

Code specification

4.2 With display of hits

As an option to the standard variant, this variant can be used when an auto-completion list always contains more than the maximum ten hits shown.

Image of the autocompletion component with display of hits

Design specification

Code specification

4.3 Mit statischen Einträgen

Image of the autocompletion component with static entries

Design specification

Code specification