Typography
Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.
Typography on HummingbirdText alignment
Easily realign text to components with text alignment classes. For start, end, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system.
<p class="text-start">Start aligned text on all viewport sizes.</p>
<p class="text-center">Center aligned text on all viewport sizes.</p>
<p class="text-end">End aligned text on all viewport sizes.</p>
<p class="sm:text-start">Start aligned text on viewports sized SM (small) or wider.</p>
<p class="md:text-start">Start aligned text on viewports sized MD (medium) or wider.</p>
<p class="lg:text-start">Start aligned text on viewports sized LG (large) or wider.</p>
<p class="xl:text-start">Start aligned text on viewports sized XL (extra-large) or wider.</p>
Start aligned text on all viewport sizes.
Center aligned text on all viewport sizes.
End aligned text on all viewport sizes.
Start aligned text on viewports sized SM (small) or wider.
Start aligned text on viewports sized MD (medium) or wider.
Start aligned text on viewports sized LG (large) or wider.
Start aligned text on viewports sized XL (extra-large) or wider.
Text wrapping and overflow
Wrap text with a .text-wrap class. Prevent text from wrapping with a .text-nowrap class.
<div class="badge text-white bg-primary text-wrap mb-4 w-24">This text should wrap.</div>
<div class="text-nowrap bg-body-tertiary w-32">This text should overflow the parent.</div>
Word break
Prevent long strings of text from breaking your component's layout by using .wrap-break-word to set word-wrap: break-word.
<p class="wrap-break-word">mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm</p>
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Text transform
Transform text in components with text capitalization classes.
<p class="lowercase">Lowercase text.</p>
<p class="uppercase">Uppercase text.</p>
<p class="capitalize">Capitalized text.</p>
Lowercase text.
Uppercase text.
Capitalized text.
Font size
Quickly change the font-size of text. While our heading classes (e.g., .h1–.h6) apply font-size, font-weight, and line-height, these utilities only apply font-size. Sizing for these utilities matches HTML’s heading elements, so as the number increases, their size decreases.
<h6 class="text-xs">.text-xs</h6>
<h6 class="text-sm">.text-sm</h6>
<h6 class="text-base">.text-base</h6>
<h6 class="text-lg">.text-lg</h6>
<h6 class="text-xl">.text-xl</h6>
<h6 class="text-2xl">.text-2xl</h6>
<h6 class="text-3xl">.text-3xl</h6>
<h6 class="text-4xl">.text-4xl</h6>
<h6 class="text-5xl">.text-5xl</h6>
<h6 class="text-6xl">.text-6xl</h6>
<div class="mt-3">
<h6 class="sm:text-base">.sm:text-base</h6>
<h6 class="md:text-lg">.md:text-lg</h6>
<h6 class="lg:text-xl">.lg:text-xl</h6>
<h6 class="xl:text-2xl">.xl:text-2xl</h6>
</div>
.text-xs
.text-sm
.text-base
.text-lg
.text-xl
.text-2xl
.text-3xl
.text-4xl
.text-5xl
.text-6xl
.sm:text-base
.md:text-lg
.lg:text-xl
.xl:text-2xl
Font weight
Quickly change the font-weight or font-style of text with these utilities. font-weight utilities are abbreviated as .font-*.
<div class="font-light">Font weight 300</div>
<div class="font-normal">Font weight 400</div>
<div class="font-medium">Font weight 500</div>
<div class="font-semibold">Font weight 600</div>
<div class="font-bold">Font weight 700</div>
<div class="font-extrabold">Font weight 800</div>
<div class="font-black">Font weight 900</div>
Line height
Change the line height with .leading-* utilities.
<p class="leading-none">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
</p>
<p class="leading-sm">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="leading-base">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="leading-lg">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
Heading
<h1>h1. Heading</h1>
<h2>h2. Heading</h2>
<h3>h3. Heading</h3>
<h4>h4. Heading</h4>
<h5>h5. Heading</h5>
<h6>h6. Heading</h6>
h1. Heading
h2. Heading
h3. Heading
h4. Heading
h5. Heading
h6. Heading
Heading classes
<p class="h1">h1. Heading</p>
<p class="h2">h2. Heading</p>
<p class="h3">h3. Heading</p>
<p class="h4">h4. Heading</p>
<p class="h5">h5. Heading</p>
<p class="h6">h6. Heading</p>
h1. Heading
h2. Heading
h3. Heading
h4. Heading
h5. Heading
h6. Heading
Display
<h1 class="display-1 mb-4">Display 1</h1>
<h1 class="display-2 mb-4">Display 2</h1>
<h1 class="display-3 mb-4">Display 3</h1>
<h1 class="display-4 mb-4">Display 4</h1>
<h1 class="display-5 mb-4">Display 5</h1>
<h1 class="display-6 mb-4">Display 6</h1>
Display 1
Display 2
Display 3
Display 4
Display 5
Display 6
Font family
You have three font-family helper classes available to use.
<p>Nunito sans</p>
<code class="font-monospace">Monospace</code>
Nunito sans
Monospace
Text decoration
Decorate text in components with text decoration classes.
<p class="underline">This text has a line underneath it.</p>
<p class="line-through">This text has a line going through it.</p>
<a class="no-underline" href="#">This link has its text decoration removed</a>
This text has a line underneath it.
This text has a line going through it.
This link has its text decoration removed
