Text utilities
- Search results, article excerpts and compact product descriptions.
Composition and API
TruncateText accepts string children and positive integer lines. ExpandableText supports controlled state, localized labels and showToggle="always" as a measurement fallback. useTextOverflow observes resize, text and font changes and can measure a collapsed text-only copy.
Accessibility
The full text remains in the accessibility tree. Expansion changes visual presentation. A native button exposes aria-expanded and aria-controls; a hidden measurement copy is inaccessible and immediately removed.
FAQ
Is an animation package required?
No. These primitives use native HTML, CSS and an optional client measurement hook. They do not import Motion.