white-space
Utilities for controlling an element’s white-space property.
| Class | Effect |
|---|---|
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; |
whitespace-break-spaces |
white-space: break-spaces; |
Examples
Section titled “Examples”Preserving whitespace
Section titled “Preserving whitespace”Use whitespace-pre to keep spaces and line breaks exactly as written; whitespace-pre-line keeps line breaks but collapses spaces.


if ui.div("grid grid-cols-2 gap-6") { ui.text("Hey everyone!\n\nIt's almost 2022 and we still don't know if there is aliens living among us.", "whitespace-normal text-sm text-gray-700 dark:text-gray-300") ui.text("Hey everyone!\n\nIt's almost 2022 and we still don't know if there is aliens living among us.", "whitespace-pre-line text-sm text-gray-700 dark:text-gray-300")}