TextLabel captions form controls or definitions with contextual information.
| # | Required | Element | Description |
|---|---|---|---|
| 1 | Text container | Inline element that renders label text in subtle color and a smaller font size. |
TextLabel is a focused typographic component built on top of Text and using the product-label text style. TextLabel is best used in the following contexts:
If none of these use cases apply, consider using Text directly with the appropriate text styles.
TextLabel uses the subtle text color by default to better complement its smaller font size in its role as supporting text. Color may be changed to any color inherited from the Text component to fit the required semantic need.
Subtle color serves as the default to emphasize the TextLabel's role.
TextLabel uses the product-label text style by default: a smaller font size (xxs), medium font weight, and subtle letter spacing. Typography options like font size, weight, family, and style can all be manually overridden with the props inherited from Text.
The product-label text style keeps labels compact and visually distinct from body text and headings.
Keep labels to one to three words maximum. If a label requires additional context, add a help icon with a Tooltip or a description below the label rather than adding to the label itself.
When a label is associated with a form control that answers a yes-or-no question or asks the user to choose between options, phrase the label as a direct question to leave no room for misinterpretation. This pattern is common for Toggles, RadioGroups, and Selects.