Skip to main content

Typography

The base font size is 14px. All other font sizes are based on this value.

Display

Traditional heading elements are designed to work best in the meat of your page content. When you need a heading to stand out, consider using a display heading—a larger, slightly more opinionated heading style.

ClassEquivalent pixelsEquivalent remsExample
.display-180px5.714remDisplay
.display-272px5.143remDisplay
.display-364px4.571remDisplay
.display-456px4remDisplay
.display-548px3.429remDisplay
.display-640px2.857remDisplay

Headings

ClassTagEquivalent pixelsEquivalent remsExample
.h1h140px2.857remHeading
.h2h232px2.286remHeading
.h3h328px2remHeading
.h4h424px1.714remHeading
.h5h520px1.429remHeading
.h6h616px1.143remHeading

Font Sizes

The base font size is 14px. All other font sizes are based on this value.

ClassEquivalent pixelsEquivalent remsExample
.fs-4xl32px2.286remExample
.fs-3xl30px2.143remExample
.fs-xxl24px1.714remExample
.fs-xl20px1.429remExample
.fs-lg16px1.143remExample
.fs-md14px (root)1remExample
.fs-sm13px0.929remExample
.fs-xs12px0.857remExample
.fs-xxs11px0.786remExample
.fs-3xs10px0.714remExample

Font Weights

Kyber's predefined font weight classes allow developers and designers to easily apply different font weights to text elements, providing fine-grained control over typography and emphasizing or de-emphasizing text as needed.

font-weight utilities are abbreviated as .fw-*.

ClassEquivalent WeightExample
.fw-light200, 300Example
.fw-normal400Example
.fw-medium500Example
.fw-semibold600Example
.fw-bold700Example

Section Headers

ClassExample
.section-header-xsSection Heading
.section-header-smSection Heading
.section-header-mdSection Heading
.section-header-lgSection Heading
.section-header-xlSection Heading

Font Family

There are 2 utility classes that can be used to apply Ivar Text Regular, Ivar Headline, and Inter font families to containers.

Result
Loading...
Live Editor
<>
	<div className="fm-ivar-text-regular">Ivar Text Regular</div>
	<div className="fm-ivar-headline">Ivar Headline</div>
	<div className="fm-inter">Inter</div>
</>

Standalone hyperlinks that do not use the <Link> component can be styled with the .klink class. Which will apply the expected text decoration and hover styling.

Result
Loading...
Live Editor
<a href="#" className="klink">
	Link
</a>

When using icons within a Link it is recommend to avoid rendering the text-decoration on hover. One option is to use the d-inline-block text-decoration-none classes on the icon.

Result
Loading...
Live Editor
<a href="#" className="klink">
	<span className="icon-trash-01 d-inline-block text-decoration-none" />
</a>

Text 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.

Result
Loading...
Live Editor
<div>
	<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="text-sm-end">End aligned text on viewports sized SM (small) or wider.</p>
	<p class="text-md-end">End aligned text on viewports sized MD (medium) or wider.</p>
	<p class="text-lg-end">End aligned text on viewports sized LG (large) or wider.</p>
	<p class="text-xl-end">End aligned text on viewports sized XL (extra large) or wider.</p>
	<p class="text-xxl-end">End aligned text on viewports sized XXL (extra extra large) or wider.</p>
</div>

Text wrapping and overflow

Wrap text with a .text-wrap class.

Result
Loading...
Live Editor
<div class="badge text-bg-primary text-wrap" style={{ width: '6rem' }}>
	This text should wrap.
</div>

Prevent text from wrapping with a .text-nowrap class.

Result
Loading...
Live Editor
<div class="text-nowrap bg-body-secondary border" style={{ width: '8rem' }}>
	This text should overflow the parent.
</div>

Text truncate

For longer content, you can add a .text-truncate class to truncate the text with an ellipsis. Requires display: inline-block or display: block.

Result
Loading...
Live Editor
<div>
	{/* Block level */}
	<div className="row">
		<div className="col-2 text-truncate">
			This text is quite long, and will be truncated once displayed.
		</div>
	</div>

	{/* Inline level */}
	<span className="d-inline-block text-truncate" style={{ maxWidth: '150px' }}>
		This text is quite long, and will be truncated once displayed.
	</span>
</div>

Word break

Prevent long strings of text from breaking your components’ layout by using .text-break to set word-wrap: break-word and word-break: break-word. We use word-wrap instead of the more common overflow-wrap for wider browser support, and add the deprecated word-break: break-word to avoid issues with flex containers.

Result
Loading...
Live Editor
<p class="text-break">
	mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
</p>

Text transform

Transform text in components with our text capitalization classes: text-lowercase, text-uppercase or text-capitalize.

Result
Loading...
Live Editor
<div>
	<p class="text-lowercase">Lowercased text.</p>
	<p class="text-uppercase">Uppercased text.</p>
	<p class="text-capitalize">CapiTaliZed text.</p>
</div>

Italics

Quickly change font-style of text with these utilities. font-style utilities are abbreviated as .fst-*.

Result
Loading...
Live Editor
<div>
	<p class="fst-italic">Italic text.</p>
	<p class="fst-normal">Text with normal font style</p>
</div>

Line height

Change the line height with .lh-* utilities.

Result
Loading...
Live Editor
<div>
	<p class="lh-1">
		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="lh-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="lh-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="lh-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>
</div>

Monospace

Change a selection to our monospace font stack with .font-monospace.

Result
Loading...
Live Editor
<p class="font-monospace">This is in monospace</p>

Reset color

Reset a text or link’s color with .text-reset, so that it inherits the color from its parent.

Result
Loading...
Live Editor
<p class="text-body-secondary">
	Secondary body text with a{' '}
	<a href="#" class="text-reset">
		reset link
	</a>
	.
</p>

Text decoration

Decorate text in components with text decoration classes.

Result
Loading...
Live Editor
<div>
	<p class="text-decoration-underline">This text has a line underneath it.</p>
	<p class="text-decoration-line-through">This text has a line going through it.</p>
	<a href="#" class="text-decoration-none">
		This link has its text decoration removed
	</a>
</div>