Intro
An input field allows users to enter and edit text or numeric values in one line.
Input – live examples
When to Use
Do
Use the input component:
- To enter a short, single-line text or number.
- To enter a password, URL, phone number, or email address.
- To select a single item from a large amount of data (for example, more than 200 items).
- To find an object by searching for more than one attribute, such as an ID, city, and customer name.
Don't
Don’t use the input component:
- To enter dates and times. Instead, use the date picker, date range selection, or date/time picker.
- To enter long texts. Use the text area component instead.
- To select multiple values. In this case, use the multi-combo box (for fewer than 200 items) or the multi-input component (for more than 200 items).
Anatomy
Anatomy of an input field
An input usually consists of a field that contains a text.
1. Field: Field container
2. Text: Placeholder or typed text
3. Icon (optional): For example, you can enable a Clear icon to remove the text that has been typed into the field.
Anatomy of an input field
Types
Value Help
https://www.sap.com/design-system/live-examples/Input/Input_SE_VariantInputwithValueHelp.html
Input field with value help
Input with a Label
Always provide a meaningful label for any input field. Labels are necessary to indicate the meaning of the input fields when the placeholders are no longer visible.
To indicate that a particular field is mandatory, set the “Required” indicator for the label. This displays an asterisk (*) next to the label associated with the field.
https://www.sap.com/design-system/live-examples/Input/Input_SE_VariantInputwithLabel.html
Input field with a label
Input as a Search
https://www.sap.com/design-system/live-examples/Input/Input_SE_VariantInputSearch.html
Input as a search field
Behavior and Interaction
Enabled, Read-Only, and Disabled States
An input field can have three states:
Enabled
https://www.sap.com/design-system/live-examples/Input/Input_SE_VariantEnabled.html
Input field – enabled
Read Only
https://www.sap.com/design-system/live-examples/Input/Input_SE_VariantReadOnly.html
Input field – read only
Disabled
https://www.sap.com/design-system/live-examples/Input/Input_SE_VariantDisabled.html
Input field – disabled
Suggestions and Autocomplete
Using suggestions and autocomplete is the quickest way for users to discover and select relevant input terms and values.
- The current typed term is always highlighted with bold text.
- Only the characters entered in the input field are highlighted, not the whole word.
- All relevant instances are highlighted, even if they occur in one line item.
https://www.sap.com/design-system/live-examples/Input/Input_SE_WithSuggestions.html
Input field with suggestions
Clear
https://www.sap.com/design-system/live-examples/Input/Input_LE_main.html
Input field with ‘Clear’ icon – live example
Responsive Behavior
If the user clicks the input field on mobile device in cozy mode, a new full screen dialog opens.
Globalization and Localization
https://www.sap.com/design-system/live-examples/Input/Input_SE_RTL.html
Input field with right-to-left text display