On this page

Usage

Which text style to use for each part of a screen, so headings, labels and body text look the same everywhere.

A clear hierarchy lets people scan a page and find what they need before reading a word. Use the same style for the same job, on every screen.

Where each style goes

Product UI uses these styles; component pages name the style each part uses. When a part isn’t listed, use the style of the nearest one with the same role.

Part Style
Page structure
Page title heading.large
Section title heading.medium
Breadcrumb body.small
Large title on empty states and onboarding heading.xlarge
Containers
Card, panel and drawer title heading.small
Item title in a grid or list of many cards heading.xsmall
Card description body.default
Dialog title heading.medium
Dialog body body.default
Group title in a form, list or menu heading.xsmall
Forms
Field label label.default
Input text and placeholder body.default
Helper and error text body.small
Checkbox and radio text body.default
Actions and navigation
Button, link button label.default
Small button label.small
Tab, menu item, side navigation item label.default
Top navigation item label.default
Data
Table header label.small
Table cell body.default
Number in a table body.default with tabular figures
ID, SKU, key in a table code.default
Badge, tag, status label.small
Number in a card, such as a KPI heading.large with tabular figures
Label under a number body.small
Feedback
Banner and toast title heading.xsmall
Banner and toast message body.default
Tooltip body.small
Timestamp, meta body.small
Reading
Help article, document, email body body.large
Inline code code.default family at the surrounding size
Integrations / Online storeOrders
Synced today1,204
Failed3
Recent ordersRetry failed

Orders copied from the online store to the ERP in the last 24 hours.

OrderStatusTotal
SO-10421Synced1,250,000 ₫
SO-10420Failed480,000 ₫
Updated 2 minutes ago
  1. Breadcrumb body.small
  2. Page title heading.large
  3. Card label body.small
  4. Number in a card heading.large + tabular figures
  5. Card title heading.small
  6. Button label.default
  7. Description body.default
  8. Table header label.small
  9. Order ID code.default
  10. Badge label.small
  11. Table cell, amount body.default + tabular figures
  12. Timestamp body.small

On websites and documentation

Websites and documentation, this site included, use the same styles. Two things differ from product UI: the page title is one step larger, and running text is body.large, because people read these pages rather than scan them.

Part Style
Site header
Top navigation item label.default
Search field body.default
Keyboard shortcut hint label.small
Search result title label.default
Search result description body.small
Sidebar
Section heading.xsmall
Group label label.small
Page and sub-page label.default
Table of contents
Title (“On this page”) heading.xsmall
Link label.default
Page
Breadcrumb body.small
Page title heading.xlarge
Lede under the title body.large
Section title (h2) heading.large
Subsection title (h3) heading.medium
Minor title (h4) heading.small
Running text and lists body.large
Table text body.default
Table header label.small
Code block code.default
Inline code code.default family at the surrounding size
Card title heading.small
Card text body.default
Status badge label.small
Tabs label.default
Previous and next links body.small label, heading.small page name
Footer and page meta body.small

Using the styles

In CSS, each style is one font declaration:

.page-title  { font: var(--bh-font-heading-large); }
.card-title  { font: var(--bh-font-heading-small); }
.field-label { font: var(--bh-font-label-default); }
.helper-text { font: var(--bh-font-body-small); }
.kpi-value   { font: var(--bh-font-heading-large); font-variant-numeric: tabular-nums; }
  • Use a style as a whole. Don’t take its size and set your own weight or line height: a near-miss style looks like a mistake next to the real one.
  • Don’t make a new style for one screen. If a role is missing, ask the design system team to add it.
  • Set colour separately, with color.text.* tokens.
  • Show the selected item, such as the current page or tab, with colour and an indicator bar, not with a heavier weight: a bolder word gets wider and shifts its neighbours.
  • Bold inside text (<strong>, <b>) is semibold, 600. Weight 700 stays with the display styles.
  • When one row mixes styles, such as an order ID in code.default, a badge and an amount in body.default, align the text on its baseline (vertical-align: baseline, or align-items: baseline in flex), not on the middle. Each style sits differently in its line height, so centring them puts the letters at different heights.

Sizes on small screens

  • Product styles keep their size on every screen. Text that changes size between breakpoints makes dense screens harder to learn.
  • Display styles step down below 768 px (breakpoint.md): display.large and display.medium become display.small, and display.small becomes heading.xlarge.
  • All sizes are in rem, so text follows the reader’s browser setting and zoom.

Hierarchy

  • One page title (h1) per page. Go down the heading levels in order, without skipping one.
  • Mark up structure with headings, not with bold or larger paragraphs.
  • Show importance with size and weight first. Don’t rely on colour alone.

Readability

  • Keep lines to about 100 characters or fewer: put long text on a Narrow page (see Page widths).
  • Align text to the left, ragged right. Don’t justify it; center only short, standalone text.
  • Write in sentence case. Don’t set text in all caps: it is slower to read, and in Vietnamese the marks crowd the line above.
  • Use italics sparingly, for titles and terms.

Long text

Order names, URLs and IDs have no length limit.

  • Truncate one-line text with an ellipsis, and always give another way to read the full value, such as a tooltip or a detail view.
  • Let long unbroken strings, such as URLs and keys, break anywhere rather than overflow.
  • Never truncate text people need to finish a task.

Do and don’t

Do

Use a text style as a whole: size, weight and line height together.

Don’t

Don’t take a style’s size and set your own weight or line height. The near miss looks like a mistake.

Do

Write in sentence case.

Don’t

Don’t set text in all caps. It is slower to read, and Vietnamese marks crowd the line above.

Do

Let a long name wrap, so people can read all of it.

Don’t

Don’t cut off text people need to tell items apart.

Accessibility

  • Text needs a contrast of at least 4.5 : 1 with its background; large text (24 px, or 18.66 px bold) at least 3 : 1. See Color.
  • Set sizes in rem and never block zoom, so text can grow to 200% (WCAG 1.4.4).
  • Don’t put text in images. Real text scales, translates and reads aloud.