Text input
The following page documents visual specifications such as color, typography, structure, and size.
Color
Text input color
Element | Property | Color token |
---|---|---|
Label | text color | $text-secondary |
Field text | text color | $text-primary |
Placeholder text | text color | $text-placeholder |
Helper text | text color | $text-helper |
Field | background-color | $field * |
border-bottom | $border-strong * |
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Example of an enabled text input in the default style Example of an enabled text input in the default style](/static/40e069ce48f08c05c4999b839a569eac/3cbba/text-input-style-color-fixed.png)
![Example of an enabled text input in the fluid style Example of an enabled text input in the fluid style](/static/11add759abeba6a8b338de6448510b83/3cbba/text-input-style-color-fluid.png)
Interactive state color
State | Element | Property | Color token |
---|---|---|---|
Focus | Field | border | $focus |
Invalid | Field | border | $support-error |
Error message | text color | $text-error | |
Error icon | svg | $support-error | |
Warning | Warning message | text color | $text-primary |
Warning icon | svg | $support-warning | |
Disabled | Field | background | $field * |
Field (default) | border-bottom | transparent | |
Field (fluid) | border-bottom | $border-subtle * | |
Field text | text color | $text-disabled | |
Read-only | Field (default) | background | transparent |
Field (fluid) | background | $field * | |
Field text (default) | text color | $text-primary | |
Field text (fluid) | text color | $text-secondary | |
Field | border-bottom | $border-subtle * |
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Examples of text input states in the default style Examples of text input states in the default style](/static/6589fd21054520c4ca3fefc2b2c49184/3cbba/text-input-style-states-fixed.png)
![Examples of text input states in the fluid style Examples of text input states in the fluid style](/static/c2e1f0ef39a9f5f4b4afa464048d846e/3cbba/text-input-style-states-fluid.png)
Text area color
Element | Property | Color token |
---|---|---|
Label | text color | $text-secondary |
Field text | text color | $text-primary |
Placeholder text | text color | $text-placeholder |
Helper text | text color | $text-helper |
Field | background-color | $field * |
border-bottom | $border-strong * |
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Example of an enabled text area in the default style Example of an enabled text area in the default style](/static/15e5f8a42dd757b90a8e92a05cbeeb2e/3cbba/text-area-style-color-fixed.png)
![Example of an enabled text area in the fluid style Example of an enabled text area in the fluid style](/static/9b9d6ea79d45ff99b755fc668f867c49/3cbba/text-area-style-color-fluid.png)
Interactive state color
State | Element | Property | Color token |
---|---|---|---|
Focus | Field | border | $focus |
Invalid | Field | border | $support-error |
Error message | text color | $text-error | |
Error icon | svg | $support-error | |
Warning | Warning message | text color | $text-primary |
Warning icon | svg | $support-warning | |
Disabled | Field | background | $field * |
Field (default) | border-bottom | transparent | |
Field (fluid) | border-bottom | $border-subtle * | |
Field text | text color | $text-disabled | |
Read-only | Field (default) | background | transparent |
Field (fluid) | background | $field * | |
Field text (default) | text color | $text-primary | |
Field text (fluid) | text color | $text-secondary | |
Field | border-bottom | $border-subtle * |
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Examples of text area states in the default style Examples of text area states in the default style](/static/40963b58e67c9feac0bf868c571755bf/3cbba/text-area-style-states-fixed.png)
![Examples of text area states in the fluid style Examples of text area states in the fluid style](/static/a51f09ee59e77b4a1b2d60fc5b72f82f/3cbba/text-area-style-states-fluid.png)
Typography
Text input labels and field 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.
Element | Font-size (px/rem) | Font-weight | Type token |
---|---|---|---|
Label | 12 / 0.75 | Regular / 400 | $label-01 |
Field text | 14 / 0.875 | Regular / 400 | $body-compact-01 |
Helper text | 12 / 0.75 | Regular / 400 | $helper-text-01 |
Error and warning message | 12 / 0.75 | Regular / 400 | $label-01 |
Structure
Default text input structure
Element | Property | px / rem | Spacing token |
---|---|---|---|
Label | margin-bottom | 8 / 0.5 | $spacing-03 |
Helper text | margin-top | 4 / 0.25 | $spacing-02 |
Input text | padding-left, padding-right | 16 / 1 | $spacing-05 |
Field | border-bottom | 1px | – |
Focus | border | 2px | – |
Error | border | 2px | – |
![Structure and spacing measurements for default text input Structure and spacing measurements for default text input](/static/a576b1cfdbc7a1333462a80937b4d94a/3cbba/text-input-style-structure-fixed.png)
Structure and spacing measurements for default text input | px / rem
Fluid text input structure
Element | Property | px / rem | Spacing token |
---|---|---|---|
Label | padding-bottom | 4 / 0.25 | $spacing-02 |
Field | height | 64 / 4 | $spacing-10 |
padding-left, padding-right | 16 / 1 | $spacing-05 | |
padding-top, padding-bottom | 13 / 0.8125 | – | |
border-bottom | 1px | – | |
Focus | border | 2px | – |
Error | border | 2px | – |
![Structure and spacing measurements for fluid text input Structure and spacing measurements for fluid text input](/static/9056540a57f5ada3672e48c52a77d0d7/3cbba/text-input-style-structure-fluid.png)
Structure and spacing measurements for fluid text input | px / rem
Default text area structure
Element | Property | px / rem | Spacing token |
---|---|---|---|
Label | margin-bottom | 8 / 0.5 | $spacing-03 |
Field | height | varies | – |
padding-left, padding-right | 16 / 1 | $spacing-05 | |
padding-top, padding-bottom | 11 / 0.6875 | – | |
border-bottom | 1px | – | |
Field: focus | border | 2px | – |
Helper text | margin-top | 4 / 0.25 | $spacing-02 |
![Structure and spacing measurements for default text area Structure and spacing measurements for default text area](/static/92b143a100daedbe20c59cd952d0abea/3cbba/text-area-style-structure-fixed.png)
Structure and spacing measurements for default text area | px / rem
Fluid text area structure
Element | Property | px / rem | Spacing token |
---|---|---|---|
Label | margin-bottom | 4 / 0.25 | $spacing-02 |
Field | height | varies | – |
padding-left, padding-right | 16 / 1 | $spacing-05 | |
padding-top, padding-bottom | 11 / 0.6875 | – | |
border-bottom | 1px | – | |
Field: focus | border | 2px | – |
![Structure and spacing measurements for fluid text area Structure and spacing measurements for fluid text area](/static/1001a503d4d6a8f17b5a853891fa203e/3cbba/text-area-style-structure-fluid.png)
Structure and spacing measurements for fluid text area | px / rem
Size
These sizes apply only to the default style of text input.
Element | Size | Height (px / rem) |
---|---|---|
Input | Small (sm) | 32 / 2 |
Medium (md) | 40 / 2.5 | |
Large (lg) | 48 / 3 |
![Sizes for text input Sizes for text input](/static/33cc8b9cf517a837ea8e29f830b7aaac/3cbba/text-input-style-size.png)
Text input default style sizes | px / rem
Feedback
Help us improve this component by providing feedback, asking questions, and leaving any other comments on GitHub.