Text

The digital written word, which transcends time and space, has become an integral part of our lives, a testament to the incredible power of human innovation.

Gone are the days when writing was a slow and arduous process, confined to parchment and ink. Today, the digital written word flows like a river, effortlessly conveying the thoughts and ideas of millions of people in real-time. The digital written word is a testament to the limitless potential of human creativity and the power of technology to connect us in ways never before imagined.

Whether we are reading a novel on an electronic device, sending a message across the globe in a matter of seconds, or collaborating on a document with colleagues halfway around the world, the digital written word has forever changed the way we communicate and share information. It has opened up new avenues of learning, creation, and discovery, and has helped to bridge the gap between cultures and generations. Let's give it the importance it deserves.

[JSX] Component

<Text>Alice’s Adventures in Wonderland</Text>

[HTML] Rendered

<span class="paragraph">Alice’s Adventures in Wonderland</span>

type

Each type of text serves a unique purpose, and when used in concert, they form a symphony of information, guiding the user through the labyrinth of digital interfaces. Their precise and calculated placement, size, and style, hold the power to convey meaning, evoke emotions, and inspire action.

display

The display text type is the largest of them all. It is used for impactful text that requires a larger amount of screenspace to convey an extremely important message. It is an opportunity to create visual impact and set the tone for the overall design. I think things like brand mottos, hot takes, or one-sentence announcement work great for a display type. It represents the designer's voice and intention, guiding the user's experience.

  • Avoid this text type on devices with smaller screens.

[JSX] Component

<Text type="display">Alice’s Adventures in Wonderland</Text>

[CSS] Style

span.display {
  font-size: 3.8rem;
  line-height: 4rem;
  font-weight: 600;
}
  • Example with visible margins
margin-top: 2rem;
Alice’s Adventures in Wonderland
margin-bottom: 1rem;

title

A title is a text type that is used in the largest true heading and functions as a page title. It serves as a succinct description of the content and provides context to the user. It is an opportunity to create structure within the design and be representative of the content's identity and purpose.

  • There must only be one title per page; anything else must be able to fit on the heading and subheading text types.
  • A display type must not be used as a "larger title".

[JSX] Component

<Text type="title">Alice’s Adventures in Wonderland</Text>

[CSS] Style

span.title {
  font-size: 2.8rem;
  line-height: 3rem;
  font-weight: 600;
}
  • Example with visible margins
margin-top: 2rem;
Alice’s Adventures in Wonderland
margin-bottom: 1rem;

heading

A heading type is one intended to divide the content into manageable sections and provide structure to a page. It guides the user's understanding of the content. You can have more than one heading because they are meant to identify multiple parts of a page.

[JSX] Component

<Text type="heading">Chapter I: Down the Rabbit-Hole</Text>

[CSS] Style

span.heading {
  font-size: 2rem;
  line-height: 2.5rem;
  font-weight: 600;
}
  • Example with visible margins
margin-top: 2rem;
Chapter I: Down the Rabbit-Hole
margin-bottom: 1rem;

subheading

The subheading type is used to further divide the content into smaller sections and provide additional context. It can refine the user's understanding of the content and give it more clarity. A subheading has the base color like the paragraph does but is significantly larger and bold like the other heading types.

  • This type must not be used as a "smaller" version of a heading or a title.

[JSX] Component

<Text type="subheading">Chapter I: Down the Rabbit-Hole</Text>

[CSS] Style

span.subheading {
  font-size: 1.8rem;
  line-height: 2.1rem;
  font-weight: 400;
}
  • Example with visible margins
margin-top: 2rem;
Chapter I: Down the Rabbit-Hole
margin-bottom: 1rem;

paragraph

A paragraph is the default text type of the component, but it can be explicitly stated even though is a bit redundant. Its size and style are designed to be easily readable and provide a comfortable reading experience. By design, it has a large line-height, this so inline code blocks won't create a larger row of text when existing, different from the rest of the paragraph.

[JSX] Component

<Text>By Lewis Caroll</Text>
<Text type="paragraph">By Lewis Caroll</Text>

[CSS] Style

span.paragraph {
  font-size: 1.8rem;
  line-height: 2.1rem;
  font-weight: 400;
}
  • Example with visible margins
margin-top: 0.5rem;
By Lewis Caroll
margin-bottom: 1rem;

small

The small type is useful for text that must not take up as much screen space as a paragraph would. But one must be wary of this, if you want to "hide" that information, why even put it there in the first place? I would advise replacing this with other ways of conveying the same information.

There are times when there's an obligation for it to be visible as text, like the Terms and Conditions or Privacy Policy links. Even though, the small text type must rarely be used and must avoid using extensive text and limit its content to a few words only.

[JSX] Component

<Text type="small">THE MILLENNIUM FULCRUM EDITION 3.0</Text>

[CSS] Style

span.small {
  font-size: 1.8rem;
  line-height: 2.1rem;
  font-weight: 400;
}
  • Example with visible margins
margin-top: 0;
THE MILLENNIUM FULCRUM EDITION 3.0
margin-bottom: 0.5rem;

Component Props

noMargins

This property is used for only removing the margins from any text type. This is useful when the margins add too much white space in certain unique layouts (e.g. A text component being a child of a CSS grid with a fixed gap). Not to be confused with the compressed component property that reduces the element's line-height.

[JSX] Component

<Text type="subheading" noMargins>Chapter I: Down the Rabbit-Hole</Text>
  • Example with visible margins
margin-top: 0;
Chapter I: Down the Rabbit-Hole
margin-bottom: 0;

inheritColor

This property will remove any color setting on the text component and instead, it will add color: inherit; to its styles. This way one could assign a text color from a higher element and this text will just inherit it.

[JSX] Component

<Text inheritColor>Chapter I: Down the Rabbit-Hole</Text>

compact

The compact property is a boolean value that is used to lower the text's height. It reduces its line-height as well as its margins.

[JSX] Component

<Text compact>Alice was beginning to get very tired of sitting...</Text>
  • Comparison of default and compact texts
Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, “and what is the use of a book,” thought Alice “without pictures or conversations?”Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, “and what is the use of a book,” thought Alice “without pictures or conversations?”

single

The art of clamping a lengthy text into a single line is a delicate dance between brevity and meaning. With an emphasis on the first few words, the essence of the text must be captured, like the first brushstrokes of a masterpiece. The ellipsis at the end, a simple dot-dot-dot, whispers of more to come, hinting at the depths of thought beyond the constraints of the viewport. The final result is a single line of text.

[JSX] Component

<Text single>Alice was beginning to get very tired...</Text>