Truncate
Text that clips with an ellipsis and shows its full value in a quick tooltip on hover, only while it's actually clipped. It's the rule across the system: every truncated value goes through Truncate, and lint rejects a bare truncate or line-clamp class.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { Truncate } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Hartley Okafor Moreau Family Trust
Props
lines
inline
side
align
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Wrap every value that can be cut off, like a matter name in a table cell or an email in a header, so the whole value shows in a tooltip while it is clipped. |
| Do | Give the parent a width or min-w-0 in a flex row, so the value has an edge to truncate against. |
| Do | Use lines for a description that may wrap, so it keeps two or three lines before the ellipsis. |
| Don't | Use a bare truncate, line-clamp-* or text-ellipsis class. The reader loses the rest of the value, and lint rejects it. |
| Don't | Truncate a value the reader must act on in full, like an amount or a matter number. Give it the room instead. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children * | ReactNode | — | The text. It clips with an ellipsis when it doesn't fit. |
| value | ReactNode | — | The full value for the tooltip, when children isn't plain text. Defaults to children. |
| lines | 1 | 2 | 3 | 1 | How many lines before it clips. |
| inline | boolean | false | A span for inside a line of text; a div otherwise. |
| side | "top" | "right" | "bottom" | "left" | "top" | Which side it opens on. It flips to the other when there isn't room. |
| align | "start" | "center" | "end" | "start" | How it lines up along that side: start, center or end. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
Code
What the playground shows, ready to copy.
import { Truncate } from "@leap-crm/design-system";
<Truncate>Hartley Okafor Moreau Family Trust</Truncate>




