Text provides overflow handling. It renders a div by default and inherits typography from its surroundings.
Usage
Give the text a constrained width, then settruncate to show an ellipsis when it overflows:
Limit the number of lines
UselineClamp with a positive integer. Choose either truncate or lineClamp; their props are mutually exclusive.
Choose an element
Userender when the text needs another semantic element:
Props
Native attributes, children, refs, class names, and styles target the rendered text element.TextProps is exported from twenty-ui/primitives/typography. Text content is rendered unchanged, including caller-provided links.
number
Positive integer limiting the number of visible lines. Cannot be combined with
truncate.ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>
Replaces the default div. Native props and the ref target the rendered text element.
boolean
Truncates one line with an ellipsis. Cannot be combined with
lineClamp.