Skip to content

Text

CSS utility classes to style text. It is recommended that you first look at the h-text component and use that if possible.

Class names

ClassDescription
text-xsExtra small font size.
text-smSmall font size.
text-baseNormal font size.
text-lgLarge font size.
text-xlExtra large font size.
text-leftAlign text to the left.
text-rightAlign text to the right.
text-centerAlign text to the center of the container.
text-justifyJustify text.
text-ellipsisEllipsis on text overflow.
text-wrapWrap text.
text-nowrapDo not wrap text.
ClassDescription
font-boldBold font weight.
font-semiboldSemibold font weight.
font-mediumMedium font weight.
font-normalNormal font weight.
font-lightLight font weight.
ClassDescription
italicItalic font style.
uppercaseTransform text to be all in uppercase.
lowercaseTransform text to be all in lowercase.
capitalizeCapitalize words in text.
truncateDo not wrap text and use ellipsis when it overflows.
align-middleAlign text in the middle of its container.
whitespace-nowrapPrevent text from wrapping within its container.
whitespace-prePreserve newlines and spaces, no wrapping.
whitespace-pre-wrapPreserve newlines and spaces, wrap normally.

Examples

Text size


html
<p class="text-xs">Extra small</p>
<p class="text-sm">Small</p>
<p class="text-base">Base</p>
<p class="text-lg">Large</p>
<p class="text-xl">Extra large</p>
<p class="text-2xl">Extra large (x2)</p>
<p class="text-3xl">Extra large (x3)</p>
<p class="text-4xl">Extra large (x4)</p>