When to use
Section titled “When to use”Text is for body copy, labels, captions and figures. Size, weight and colour come from tokens; you do not write classes by hand.
When not to use
Section titled “When not to use”- For headings: Heading builds the document structure; do not enlarge Text to look like a heading.
- To add classes: Do not change size or colour with
className; usesize,weightandtone. - For links and actions: Text is not clickable; use Button for an action.
Anatomy
Section titled “Anatomy”Text has one part: a <span> (or the element you give with render).
- Root: the type style chosen by size and weight, the colour chosen by tone, and a line limit with
truncate.
Behaviour
Section titled “Behaviour”- Defaults are
size="md"(14 px),weight="regular"andtone="default". weight="medium"gives the label style of the same size (sm12 px,md14 px).lg(16 px) has the regular weight only;lgwithmediumfails type checking.truncatecuts at one line (true) or at 2-6 lines; give the full text to the user another way.numericturns on equal-width digits (tabular-nums).- Margin is zero (
m-0); the surrounding Stack or Inline sets the spacing.
Guidelines
Section titled “Guidelines”Do not let colour carry meaning alone
Section titled “Do not let colour carry meaning alone”Error: the field cannot be empty.
Field
Give the full text of truncated copy
Section titled “Give the full text of truncated copy”Sample text is a very long sentence
Sample text is a very long sentence
Content
Section titled “Content”- Write in sentence case; avoid needless capitals.
- Keep labels short; put detail in a description.
- Use
numericwhen numbers or dates sit in a column.