Navigieren auf digital.sbb.ch

Textfield

1. What does the component do?

  • It is used for the entry of text and numbers.

2. When should the component be used?

  • When an entry is required from the user.

3. Rules

  • An entry field always has a label.
  • A question mark in the circle can also be shown – in addition to the label – for detailed explanations. A tooltip opens when this question mark is clicked on.
  • The entry text is always single-line.
  • If the text becomes longer than the width of the entry field during the entry, the text entered is pushed to the left so that what is currently being written can always be seen.
  • After leaving the entry field with a long text, this is cut off at the end and designated with “…”.
  • An entry field can contain a placeholder which is shown directly in the entry field provided no value has been entered by the user.
  • If the user can never edit a form field, no entry field can be used (display as text).

4. Variants and statuses

The component has the following statuses:

  • Default
  • Placeholder
  • Focused
  • Disabled
  • Error
  • Mandatory
  • Readonly

4.1 Standard

Image of the text field component in the standard variant

Design specification

Code specification

4.2 Password entry

Image of the text field component in the password entry variant
  • The entry field in the ‘password’ variant does not provide a ‘Placeholder’ status.

Design specification

4.3 Clearable

Image of the text field component with possibility to clear the value by one click

Design spezification