Typography utilities
Alignment
.eui-textLeft className
Changes the elementβs text alignment to the left/starting side of its container.
tsx code block:<div className="eui-textLeft"> /* Your content */ </div>
tsx code block:<div className="eui-textCenter"> /* Your content */ </div>
.eui-textRight className
Changes the elementβs text alignment to the right/ending side of its container.
tsx code block:<div className="eui-textRight"> /* Your content */ </div>
Wrapping
euiTextTruncate(maxWidth?) function
Truncates text at 100% width of its parent and will display an ellipsis.
This utility accepts a single optional parameter for customizing the maximum width of the truncated text. If not passed, it defaults to max-width: 100%;.
Tip: When truncating text, it is recommended to include the full text within an HTML title attribute or by wrapping the element within an EuiToolTip.
tsx code block:css` ${euiTextTruncate()} `
tsx code block:<div className="eui-textTruncate" title="Your content"> /* Your content */ </div>
euiTextBreakWord() function
Wraps the text across lines like normal, but forces long words like URLs to break.
tsx code block:css` ${euiTextBreakWord()} `
.eui-textBreakWord className
Applies the euiTextBreakWord() styles as an overriding CSS utility class.
tsx code block:<div className="eui-textBreakWord"> /* Your content */ </div>
tsx code block:<div className="eui-textNoWrap"> /* Your content */ </div>
.eui-textBreakAll className
Wraps the text across lines always forcing the last word on the line to break.
tsx code block:<div className="eui-textBreakAll"> /* Your content */ </div>
.eui-textBreakNormal className
Reverts the text back to the normal wrapping scheme of not forcing word breaks.
tsx code block:<div className="eui-textBreakNormal"> /* Your content */ </div>