Text Input

Text inputs are input fields typically used in forms that allow the user to enter text data in a structured format.

Specifications

Text input design specifications
Text input design specifications
Autosuggest text input design specifications
Autosuggest text input design specifications

States

Text input states: enabled, hover, focus, error and disabled.

Text input states
Text input states

List option states: enabled, hover, active and system.

List option states
List option states

Anatomy

Text input anatomy
  1. 1.
    Label text
  2. 2.
    Helper text (Optional)
  3. 3.
    Error indicator
  4. 4.
    Clear action (Optional)
  5. 5.
    Input action (Optional)
  6. 6.
    Input container
  7. 7.
    Placeholder text
  8. 8.
    Error message
  9. 9.
    Prefix
Autosuggest anatomy
  1. 1.
    List dialog
  2. 2.
    Text input
  3. 3.
    List option
  4. 4.
    List option value

Design tokens

Color

Base

Component tokenElementCore tokenValue
labelFontColorLabelcolor-black#000000
valueFontColorValuecolor-black#000000
helperTextFontColorHelper textcolor-black#000000
placeholderFontColorPlaceholdercolor-grey-600#808080
enabledBorderColorBorder:enabledcolor-black#000000
actionIconColorAction iconcolor-black#000000
actionBackgroundColorActioncolor-transparenttransparent
suffixColorSuffixcolor-grey-700#666666
prefixColorPrefixcolor-grey-700#666666
listOptionFontColorList option valuecolor-black#000000
listOptionDividerColorList option dividercolor-grey-200#e6e6e6
listDialogBorderColorList dialogcolor-grey-400#bfbfbf
listDialogBackgroundColorList dialogcolor-white#ffffff
systemMessageFontColorSystem messagecolor-grey-700#666666

Interactive

Component tokenElementCore tokenValue
hoverBorderColorBorder:hovercolor-purple-500#a46ede
focusBorderColorBorder:focuscolor-blue-600#0095ff
errorBorderColorBorder:errorcolor-red-700#d0011b
hoverErrorBorderColorBorder:error:hovercolor-red-600#fe0123
disabledBorderColorBorder:disabledcolor-grey-500#999999
readOnlyBorderColorBorder:readonlycolor-grey-500#999999
hoverReadOnlyBorderColorBorder:readonly:hovercolor-grey-600#808080
errorMessageColorError messagecolor-red-700#d0011b
disabledContainerFillColorInput container:disabledcolor-grey-100#f2f2f2
disabledLabelFontColorLabel:disabledcolor-grey-500#999999
disabledValueFontColorValue:disabledcolor-grey-500#999999
disabledHelperTextFontColorHelper text:disabledcolor-grey-500#999999
disabledPlaceholderFontColorPlaceholder:disabledcolor-grey-500#999999
hoverActionBackgroundColorAction:hovercolor-grey-100#f2f2f2
focusActionBorderColorAction:focuscolor-blue-600#0095ff
activeActionBackgroundColorAction:activecolor-grey-300#cccccc
disabledActionBackgroundColorAction:disabledcolor-transparenttransparent
hoverActionIconColorAction icon:hovercolor-black#000000
focusActionIconColorAction icon:focuscolor-black#000000
activeActionIconColorAction icon:activecolor-black#000000
disabledActionIconColorAction icon:disabledcolor-grey-500#999999
disabledSuffixColorSuffix:disabledcolor-grey-400#bfbfbf
disabledPrefixColorPrefix:disabledcolor-grey-400#bfbfbf
hoverListOptionBackgroundColorList option:hovercolor-grey-100#f2f2f2
focusListOptionBorderColorList option:focuscolor-blue-600#0095ff
activeListOptionBackgroundColorList option:activecolor-grey-200#e6e6e6
errorListDialogFontColorList dialog errorcolor-black#000000
errorListDialogBackgroundColorList dialog errorcolor-red-50#fff5f6
errorListDialogBorderColorList dialog errorcolor-red-700#d0011b

Typography

Component tokenElementCore tokenValue
fontFamilyAllfont-family-sansOpen Sans
labelFontSizeLabelfont-scale-020.875rem / 14px
labelFontWeightLabelfont-weight-bold600
labelFontStyleLabelfont-style-normalnormal
labelLineHeightLabelfont-leading-loose-011.715em
valueFontSizeValuefont-scale-031rem / 16px
valueFontWeightValuefont-weight-regular400
valueFontStyleValuefont-style-normalnormal
helperTextFontSizeHelper textfont-scale-0112px
helperTextFontWeightHelper textfont-weight-regular400
helperTextFontStyleHelper textfont-style-normalnormal
helperTextLineHeightHelper textfont-leading-normal1.5em
optionalLabelFontWeightOptional indicatorfont-weight-regular400
listOptionFontSizeList optionfont-scale-020.875rem / 14px
listOptionFontWeightList optionfont-weight-regular400
listOptionFontStyleList optionfont-style-normalnormal
PropertyElementCore tokenValue
font-sizeError messagefont-scale-010.75rem / 12px
font-weightError messagefont-weight-regular400
line-heightValuefont-leading-normal1.5em
line-heightError messagefont-leading-normal1.5em
font-sizePlaceholderfont-scale-031rem / 16px
font-weightPlaceholderfont-regular400
font-weightList option typedfont-bold600
font-sizeSystem messagefont-scale-020.875 / 14px
font-weightSystem messagefont-regular400

Spacing

Component tokenElementCore tokenValue
inputMarginTopInput containerspacing-40.25rem / 4px
inputMarginBottomInput containerspacing-40.25rem / 4px
PropertyElementCore tokenValue
margin-leftError iconspacing-40.25rem / 4px
margin-leftActionspacing-40.25rem / 4px
margin-leftPrefixspacing-40.25rem / 4px
padding-rightPrefixspacing-80.5rem / 8px
padding-leftSuffixspacing-80.5rem / 8px
margin-leftSuffixspacing-40.25rem / 4px
margin-rightSuffixspacing-40.25rem / 4px
padding-leftInputspacing-80.5rem / 8px
padding-rightInputspacing-80.5rem / 8px
padding-leftInput containerspacing-80.5rem / 8px
padding-rightInput containerspacing-80.5rem / 8px
padding-topList dialogspacing-40.25rem / 4px
padding-bottomList dialogspacing-40.25rem / 4px
padding-leftList optionspacing-80.5rem / 8px
padding-rightList optionspacing-80.5rem / 8px
padding-topList optionspacing-20.125rem / 2px
padding-bottomList optionspacing-20.125rem / 2px
padding-leftList option valuespacing-80.5rem / 8px
padding-rightList option valuespacing-80.5rem / 8px

Border

PropertyElementCore tokenValue
borderInput containerborder-width-11px
borderInput containerborder-style-solidsolid
borderInput container:focusborder-width-11px
borderInput container:focusborder-style-solidsolid
box-shadowInput container:focus-0 0 0 2px
box-shadowInput container:error-0 0 0 2px
borderList dialogborder-width-11px
borderList dialogborder-style-solidsolid
borderList dialogborder-radius-medium0.25rem / 4px
borderList option dividerborder-width-11px
borderList option dividerborder-style-solidsolid
box-shadowList dialogshadow-default0 8px 14px -2px rgba(0,0,0,0.1)

Width

WidthValue
small240px
medium360px
large480px
fillParent100%

Margin

MarginValue
xxsmall6px
xsmall16px
small24px
medium36px
large48px
xlarge64px
xxlarge100px

And also apply different values to each side of the component: top, bottom, left and right.

Accessibility

WCAG 2.2