Skip to content
Saeede Agahi

TextField

BetaBatch B. A single-line text input with a label, help text and an error message.

When to use

Use for short free text, like a name or a search term. Always give it a label. Hide the label visually only when the purpose is obvious, like a search field with a search icon.

When not to use

For a fixed set of options, use Select or Combobox. For long text, a text area is planned.

Anatomy

USD

Budget for the next 12 months.

Enter a number.
  1. Label, with an asterisk when required
  2. Box with the input
  3. Icon before the text (optional)
  4. Suffix, such as a unit (optional)
  5. Help text (optional)
  6. Error message with an icon (when invalid)

Variants

TextField options
OptionUse
iconAn icon before the text, such as Search.
suffixShort text after the input, such as a unit.
typeAny native input type: text, email, number, search, password.
USD

States

Pictures of each state. Use the live example on the Code tab to try the component.

TextField states
DefaultHoverFocus-visibleDisabledRead-onlyInvalid
empty
Enter a supplier name.
filled
Enter a supplier name.

Errors appear when you leave a field or submit the form, never while typing. Once a field shows an error, it re-checks on every change. On submit, focus moves to the first field with an error. The live example on the Code tab shows this.