A text input allows users to enter and edit a one-line value. Values comprise text and numbers and are plain-formatted.
Input description
Use the text input component to allow users to enter or edit a one-line value, such as a username or a password.
Do
Don’t use text input forms for values longer than one line. Use a text area.
Don’t use text input forms for numerical values. Use a number input.
Don't
All text input forms are made up of an input area and its label. The label is placed above the form.
Depending on the specific flow and need, there are several design choices for a text input:
Required or optional:
Helper text or not:
Do
Don't
Text inputs consist of the following parts:
For building layouts (spacing in between inputs), use layout components. Please keep in mind that the recommended space between inputs is 16px (1em or M size). Instead of reserving additional space for potential errors, we have made the decision to reposition inputs after errors.
When users click the container of a text input form or navigate to it using the keyboard, the form changes from a default state to an active one. The text input form changes to a filled state after entering a value and clicking outside of the form (or pressing Tab).
Input forms can also be disabled in two different ways:
Text input forms have the following states:
All text input forms have labels. Make the label guiding and descriptive enough so that all intended users understand it. If the label can’t be made guiding enough, consider adding a tooltip for extra information or essential microcopy for content that all users need to see when entering a value. Whenever relevant, provide default text (a hint to help users start typing). Labels are mostly nouns, adjectives, and acronyms. Use placeholder values to guide users. Consider starting the values with an action verb.
jdbc:postgresql://server-name : server-port / database-name
Enter your username
See the content guide for more info and example of error messages in input fields.