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:
This is a pre-release version and is not production ready. For new and ongoing projects, please refer to the latest Design System version.
Use text utilities to control font family, size, alignment, wrapping, and more.
Use the class .font-sans-serif
to set the text as the default font-family.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Font Family#c55681df-4d21-469d-a5b3-c67686e7c104--font-family
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--font-family&full=true
This is sans serif text.
<p class="font-sans-serif">This is sans serif text.</p>
@use '@swisspost/design-system-styles/core' as post; .my-element { font-family: post.$font-family-sans-serif; }
The font size classes available are .fs-*
from 1 to 11, .fs-1
being the biggest and .fs-11
the smallest one.
The font sizes are responsive and will adapt with the viewport.
The font sizes .fs-1
to .fs-5
are equivalent to ones defined for the headings elements (h1 to h5), while .fs-6
is equivalent to the default body text.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Font Size#c55681df-4d21-469d-a5b3-c67686e7c104--font-size
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--font-size&full=true
This is a text.
This is a text.
This is a text.
This is a text.
This is a text.
This is a text.
This is a text.
This is a text.
This is a text.
This is a text.
This is a text.
<p class="fs-1">This is a text.</p> <p class="fs-2">This is a text.</p> <p class="fs-3">This is a text.</p> <p class="fs-4">This is a text.</p> <p class="fs-5">This is a text.</p> <p class="fs-6">This is a text.</p> <p class="fs-7">This is a text.</p> <p class="fs-8">This is a text.</p> <p class="fs-9">This is a text.</p> <p class="fs-10">This is a text.</p> <p class="fs-11">This is a text.</p>
The font weight classes available are .fw-normal
, .fw-bold
and .fw-black
.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Font Weight#c55681df-4d21-469d-a5b3-c67686e7c104--font-weight
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--font-weight&full=true
This is a normal text.
This is a bold text.
This is a black text.
<p class="fw-normal">This is a normal text.</p> <p class="fw-bold">This is a bold text.</p> <p class="fw-black">This is a black text.</p>
The font style classes available are .fst-normal
and .fst-italic
.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Font Style#c55681df-4d21-469d-a5b3-c67686e7c104--font-style
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--font-style&full=true
This is a normal text.
This is an italic text.
<p class="fst-normal">This is a normal text.</p> <p class="fst-italic">This is an italic text.</p>
The line height classes available are .lh-1
, .lh-sm
and .lh-lg
.
For good accessibility, the line height is set to 1.5
for body text and 1.2
for headings by default.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Line Height#c55681df-4d21-469d-a5b3-c67686e7c104--line-height
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--line-height&full=true
This text has a line height equal to the font size.
This text has a small line height.
This text has a large line height.
<p class="my-text lh-1">This text has a line height equal to the font size.</p> <p class="my-text lh-sm">This text has a small line height.</p> <p class="my-text lh-lg">This text has a large line height.</p>
Define how text-blocks are displayed.
Reset a text color with .text-reset
, so that an element inherits the color from its parent.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Text Color Reset#c55681df-4d21-469d-a5b3-c67686e7c104--text-color-reset
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--text-color-reset&full=true
This is a colored text with a link of the same color.
<p class="my-colored-text"> This is a colored text with a <a href="#" class="text-reset">link</a> of the same color. </p>
Easily realign text to components with text alignment classes.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Text Align#c55681df-4d21-469d-a5b3-c67686e7c104--text-align
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--text-align&full=true
Start aligned text
Center aligned text
End aligned text
<p class="text-start">Start aligned text</p> <p class="text-center">Center aligned text</p> <p class="text-end">End aligned text</p>
For start
, end
, and center
alignment, responsive classes are available that use the same viewport breakpoints as the grid system.
The responsive alignment classes have the following format: text-{breakpoint}-{alighment}
.
For more detailed informations about breakpoints read our layout docs.
Wrap text or prevent it from wrapping with the .text-wrap
and .text-nowrap
utility classes.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Text Wrapping#c55681df-4d21-469d-a5b3-c67686e7c104--text-wrapping
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--text-wrapping&full=true
This text should NOT wrap, demonstrating how text behaves without wrapping enabled.
This text should wrap, showing how text naturally breaks into multiple lines when wrapping is enabled.
<div class="my-container w-half"> <p class="text-nowrap"> This text should NOT wrap, demonstrating how text behaves without wrapping enabled. </p> </div> <div class="my-container w-half text-nowrap"> <p class="text-wrap"> This text should wrap, showing how text naturally breaks into multiple lines when wrapping is enabled. </p> </div>
Prevent long strings of text from breaking your component's layout by using the utility class .text-break
.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Word Break#c55681df-4d21-469d-a5b3-c67686e7c104--word-break
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--word-break&full=true
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
<div class="my-container w-half"> <p class="text-break">wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww</p> </div>
Transform text with the following text capitalization classes: .text-lowercase
, .text-uppercase
and .text-capitalize
.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Text Transform#c55681df-4d21-469d-a5b3-c67686e7c104--text-transform
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--text-transform&full=true
This is a Lowercased text.
This is an Uppercased text.
This is a CapiTaliZed text.
<p class="text-lowercase">This is a Lowercased text.</p> <p class="text-uppercase">This is an Uppercased text.</p> <p class="text-capitalize">This is a CapiTaliZed text.</p>
Decorate text with the following text decoration classes: text-decoration-underline
, .text-decoration-line-through
and .text-decoration-none
.
next.design-system.post.ch/?path=/docs/c55681df-4d21-469d-a5b3-c67686e7c104--docs&story=Text Decoration#c55681df-4d21-469d-a5b3-c67686e7c104--text-decoration
/?path=/story/c55681df-4d21-469d-a5b3-c67686e7c104--text-decoration&full=true
This text has a line underneath it.
This text has a line going through it.
This link has its text decoration removed.<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>