Ellipsis
Cuts text to a number of lines, with optional More and Less.
In context
Priya Nair
Interview 11: most of the crew keep a paper copy of the rota in the cab because the app is slow to open on the quay. They want shifts they can read at a glance, offline, with the next handover time shown first.
Jonas Weber
Offline sync now queues edits while the phone has no signal and replays them in order when it reconnects. Conflicts keep the newest edit and flag the older one for a look.
Maya Chen
Palette signed off.
Props
| Prop | Type | Required | Default |
|---|---|---|---|
content | string | Yes | — |
rows | number | undefined | No | 1 |
direction | EllipsisDirection | undefined | No | end |
expandText | ReactNode | No | |
collapseText | ReactNode | No | |
open | boolean | undefined | No | — |
defaultOpen | boolean | undefined | No | false |
onOpenChange | ((open: boolean) => void) | undefined | No | — |
onContentClick | ((event: MouseEvent<HTMLSpanElement, MouseEvent>) => void) | undefined | No | — |
className | string | undefined | No | — |
data-rebar-* attributes
data-rebar-component="ellipsis"; data-rebar-part="content"|"expand"|"collapse".
Migrating to Ant Design
Ant Design (web) has no direct equivalent — Typography.Text's own ellipsis prop only truncates, with no expand/collapse and no middle/start direction. This ports antd-*mobile*'s Ellipsis instead, the closest real match.