Utility classes for changing an element's white space and text overflow properties. The white space property defines how consecutive white space and text wrap is handled for labels. Overflow affects how the label behaves when the content is too big for the container's dimensions.

Classes for white space are named using the format: [text]-[value].

Where value includes:

  • wrap - for white-space: normal
  • nowrap - for white-space: nowrap
  • pre - for white-space: pre
  • prewrap - for white-space: pre-wrap

Classes for text overflow are named using the format: [text]-[value].

Where horizontal includes:

  • clip - for text-overflow: clip
  • ellipsis - for text-overflow: ellipsis
ClassContents

Note that white-space: nowrap and text-overflow: clipare the default values for white space and text overflow in Unity. Unless the value needs to be overridden from a parent, thetext-nowrap and text-clip classes are not needed.

normal will wrap when necessary
nowrap will overflow

pre will only wrap on linebreaks

newline

pre-wrap will wrap when necessary

UXML

Text overflow classes will not work if the container does not have a defined size with width/height and overflow: hidden set.

clip will cut off the text when it reaches the parent's bounds

ellipsis will change overflowing text to '...' when it reaches the parent's bounds

UXML