Browse documentation

Reference / Typography

White space

Choose whether newlines and repeated spaces survive and whether a line can wrap.

Working example

Use pre-line for intentional newlines with collapsed runs of spaces, or pre-wrap when both kinds of whitespace matter.

HTML
<p class="whitespace-pre-line border-l-2 pl-3 font-serif">Monday — print proofs
Tuesday — bind copies
Friday — open the studio</p>

Class reference

ClassCSS declarations
whitespace-normalwhite-space: normal;
whitespace-nowrapwhite-space: nowrap;
whitespace-prewhite-space: pre;
whitespace-pre-linewhite-space: pre-line;
whitespace-pre-wrapwhite-space: pre-wrap;
whitespace-break-spaceswhite-space: break-spaces;
View full generated CSS
Compiled CSS
.whitespace-break-spaces {
  white-space: break-spaces;
}
.whitespace-normal {
  white-space: normal;
}
.whitespace-nowrap {
  white-space: nowrap;
}
.whitespace-pre {
  white-space: pre;
}
.whitespace-pre-line {
  white-space: pre-line;
}
.whitespace-pre-wrap {
  white-space: pre-wrap;
}