White Space
Controls how white space is handled within an element.
Utility | Properties |
---|---|
ws-bs | white-space: break-spaces; |
ws-n | white-space: normal; |
ws-nw | white-space: nowrap; |
ws-p | white-space: pre; |
ws-pl | white-space: pre-line; |
ws-pw | white-space: pre-wrap; |
Break Spaces
This example sets the white space to break-spaces. The text will respect spaces and line breaks, allowing for wrapping at spaces.
The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition.
<div class="bg-indigo-1 p-4 rad-1"> <div class="p-4 bg-white rad-1"> <p class="tc-lead fs-lg ws-bs"> The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition. </p> </div></div>
Normal
This example sets the white space to normal. The text will wrap normally, and multiple spaces will be collapsed into a single space.
The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition.
<div class="bg-indigo-1 p-4 rad-1"> <div class="p-4 bg-white rad-1"> <p class="tc-lead fs-lg ws-n"> The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition. </p> </div></div>
No Wrap
This example sets the white space to nowrap. The text will not wrap to the next line, and it will overflow the container if it exceeds the width.
Sphinx of black quartz, judge my vow. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition.
<div class="bg-indigo-1 p-4 rad-1"> <div class="p-4 bg-white rad-1 o-x-auto"> <p class="tc-lead fs-lg ws-nw"> Sphinx of black quartz, judge my vow. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition. </p> </div></div>
Pre
This example sets the white space to pre. The text will be displayed as is, preserving spaces and line breaks.
Sphinx of black quartz, judge my vow. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition.
<div class="bg-indigo-1 p-4 rad-1"> <div class="p-4 bg-white rad-1"> <p class="tc-lead fs-lg ws-p">Sphinx of black quartz, judge my vow.It is a well-known pangram, one that has gained significant popularity and has been utilized by many people.As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition.</p> </div></div>
Pre-Line
This example sets the white space to pre-line. The text will preserve line breaks but collapse multiple spaces into a single space.
The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition.
<div class="bg-indigo-1 p-4 rad-1"> <div class="p-4 bg-white rad-1"> <p class="tc-lead fs-lg ws-pl"> The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition. </p> </div></div>
Pre-Wrap
This example sets the white space to pre-wrap. The text will preserve spaces and line breaks, and it will wrap when necessary.
The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition.
<div class="bg-indigo-1 p-4 rad-1"> <div class="p-4 bg-white rad-1"> <p class="tc-lead fs-lg ws-pw"> The quick brown fox jumps over the lazy dog. It is a well-known pangram, one that has gained significant popularity and has been utilized by many people. As a pangram, it contains all the letters of the alphabet, meeting the criteria for such a composition. </p> </div></div>
Conditional styles
Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.
You can combine responsive breakpoints like sm:ws-*
,md:ws-*
, lg:ws-*
, and xxl:ws-*
allows targeting specific utilities in different viewports.
<div class="ws-n md:ws-pw ..."></div>
Alternatively, you can apply :hover
by using h:ws-*
utility to override elements and change their values when hovering over them.
<div class="ws-n h:ws-pw ..."></div>