No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:

  1. Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the Decorators documentation.
  2. Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary settings for loaders, plugins, and other relevant parameters. You can find step-by-step guides for configuring Webpack or Vite with Storybook.
  3. Missing Environment Variables: Your Storybook may require specific environment variables to function as intended. You can set up custom environment variables as outlined in the Environment Variables documentation.

Typography

Typography design guidelines and token scales

For more checkout out our theme documentation for how to access and use all //TO-DO: add link // typography design tokens.

Our primary typeface is Aperçu Pro. It is a geometric-ish, humanist-ish sans-serif. Its voice says “we are ruled by logic, but are creative and a bit unexpected as well”. Its weight makes it attention-grabbing in dense layouts, and its legibility allows us to use it for both long-form articles and fine print.

We use Suisse Int’l Mono in order to accent designs with references to the tools, techniques and history of programming and technology. It is the seasoning we use to give our designs flavor and personality. Suisse is equally at home debating tabs v. spaces, reciting poetry, sharing tips on new courses and processing payments. But be careful—it should not be overused!

Typefaces (fontFamily)

  • Most of our designs use Aperçu Pro Bold, (Headlines, Titles) Regular (Paragraph Text, Menu Items, UI) or Italic (for emphasis)
  • Do not use Aperçu Bold to emphasize text within a line/paragraph of Aperçu Regular
  • Suisse Int’l Mono is used as an accent, in cases where items are listed/enumerated, for quotations, labels, and in other special cases.
  • Suisse Int’l Mono reads quite large for its point size, and requires extra line-height in order to be readable as text. Styles have been adjusted to account for these features.
  • Text should be left-aligned by default, using centering in some cases for Marketing emphasis or Interface specifics. You should never right-align text under normal circumstances
Prop
Path
Value
Example
accent
theme.fontFamily.accent
"Suisse"
Example Text
base
theme.fontFamily.base
"Apercu"
Example Text
monospace
theme.fontFamily.monospace
Monaco
Example Text
system
theme.fontFamily.system
-apple-system
Example Text

Aperçu Pro

Most type should be set in Aperçu. Use the Regular weight for long-form reading and areas of “default” text. Use Bold when setting important headlines, to set sub-headlines apart from similarly sized text, and for CTAs or buttons.

Aperçu should be set with a generous line-height wherever possible in order to improve readability and to avoid cramping your layout. We recommend using between 150–175% of the type size (example, 16px type would ideally use 24–28px of line-height).

Headlines should be set with reduced line-height in order to appear neat and intentional, and to help group the headline as a distinct semantic unit even when in a larger layout. 100–110% is a good default.

Suisse

When setting text in Suisse Int’l Mono, you should be aware that it is a monospace typeface, which means that every character is exactly the same width. This causes letters in paragraphs to stack into vertical columns, which can make reading it for extended periods straining.

Suisse is great for displaying numbers and snippets of code, and can be used to associate captions, facts/figures and lists with computer science, techinical rigor and the engineering community at large.

Suisse looks very large for its size, which means that typically you will want to reduce its point size by 10-15% in order for it to visually match text set in Aperçu. The text to the right was set in 14px in order to appear roughly the same size as Aperçu at 16px.

Font sizes

  • We use the term “Title” to distinguish our visual sizing from semantic designations like “H1”
Prop
Path
Value
Example
14
theme.fontSize[14]
0.875rem
Example Text
16
theme.fontSize[16]
1rem
Example Text
18
theme.fontSize[18]
1.125rem
Example Text
20
theme.fontSize[20]
1.25rem
Example Text
22
theme.fontSize[22]
1.375rem
Example Text
26
theme.fontSize[26]
1.625rem
Example Text
34
theme.fontSize[34]
2.125rem
Example Text
44
theme.fontSize[44]
2.75rem
Example Text
64
theme.fontSize[64]
4rem
Example Text

Line heights

  • Line heights are limited to multiples of 4px
  • Type boxes should be placed on the 8px placement grid like all other elements.
Prop
Path
Value
Example
base
theme.lineHeight[base]
1.5
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
spacedTitle
theme.lineHeight[spacedTitle]
1.3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
title
theme.lineHeight[title]
1.2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Line length

  • Controlling line-length is necessary to ensure text is readable and are layouts well-ordered.
  • For most multi-line text areas, keep lines to an average of 66 characters (including spaces).
  • For multi-column layouts, do not exceed 50 characters per line (including spaces).
  • The best way to control line-length is by starting with the appropriately sized text style for your design, then adjust the width / column-count of the type area until your lines fall within acceptable character counts.

Line length and alignment

Line length (the number of characters per line of text) is an important contributor to readability. You should aim for lines that run 45–85 characters in length, 66 characters being the ideal of web text. In order to accomplish this, you can usually either make the text size larger (to maintain the same width in your layout) or change the width of the text box in your layout (to maintain the original type size).

Paragraphs should almost always be left-aligned, as this is the easiest to read, and encourages layouts which align to a grid. If you must center-align a paragraph, use especially short lines and avoid texts with high word-counts. You should never right-align text in normal circumstances, unless setting numbers or equations.

Do not adjust letterspacing.