Skip to main content

Color

Text inputs come in two different colors. The default input color is $field-01 and is used on $ui-01 page backgrounds. The light version input color is $field-02 and is used on $ui-02 page backgrounds.

ClassPropertySCSSHEX
.bx--labelcolor$text-01#152935
.bx--text-inputbackground-color$field-01#f4f7fb
.bx--text-inputbox-shadow$ui-05#5a6872
.bx--text-inputcolor$text-01#152935
.bx--text-input::placeholdercolor$text-03#cdd1d4
.bx--text-input--lightbackground-color$field-02#ffffff
.bx--form__helper-textcolor$text-02#5a6872

Default and user input states for Text Input in both field colors

Examples of default and user-input states for Text Input in both $field-02 (left) and $field-01 (right)

States

ClassPropertySCSSHEX
.bx--text-input:focusbox-shadow$brand-01#3d70b2
.bx--text-input[data-invalid], .bx--text-input[data-invalid]:focusbox-shadow$support-01#e0182d
.bx--text-input:focus ~ .bx--labelcolor$brand-01#3d70b2
.bx--form-requirementcolor$support-01#e0182d
.bx--form-requirementcolor$support-01#e0182d

Active: Placeholder text should remain when the user clicks into the text input and gets a cursor. Once the user starts typing the hint text is replaced with the user input text.

Help text: Help text appears below the label when the text input is active. Help text remains visible while the input is focused and disappears after focus away.

Error: Error messages appear below the input field and are always present while invalid.

Disabled: Disabled state appears at 50% opacity and has a .not-allowed cursor on hover.

Typography

Text Input labels and placeholder text should be set in sentence case, with only the first word in a phrase and any proper nouns capitalized. Text Input labels should be three words or less.

ClassFont-size (px/rem)Font-weightType style
.bx--label14 / 0.875Semi-Bold / 600.bx--type-zeta
.bx--text-input14 / 0.875Normal / 400-
.bx--form__helper-text12 / 0.75Normal / 400.bx--type-caption
.bx--form-requirement12 / 0.75Normal / 400.bx--type-caption

Structure

ClassPropertypx / remSpacing token
.bx--text-inputheight40 / 2.5-
.bx--labelmargin-bottom8 / 0.5$spacing-xs
.bx--text-inputpadding-left, padding-right16 / 1$spacing-md
.bx--text-inputbox-shadow1px-
.bx--text-input:focusbox-shadow2px-

Structure and spacing measurements for Text Input Structure and spacing measurements for Text Input | px / rem

Examples of active, help, error and disabled Text Input states