nf-text-overflow
Multiline text folding with rich slots, responsive measurement and expand/collapse labels in eight languages.
Import the components below; see the package README for standalone installation.
Examples
Basic usage
Loading example…
Basic usage
More examples 2
Loading example…
More examples 2
Props
Text props follow the library language when omitted; defaults below use this language.
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
rows | Number of lines when collapsed. | number | string | — | 1 |
row-height | Line height in pixels. | number | string | — | 20 |
content | Text to display; the default slot takes precedence. | string | — | '' |
expand-text | Customize the “Expand” text. | string | — | Expand |
collapse-text | Customize the “Collapse” text. | string | — | Collapse |
Events
| Event | Description | Payload |
|---|---|---|
click-action | Fires on expand/collapse; includes the original mouse event and expanded state. | ({ event: MouseEvent, expanded: boolean }) |
Slots
| Parameter | Description | Payload |
|---|---|---|
default | Custom text or rich content, taking precedence over content. | — |
Methods
| Name | Type | Description |
|---|---|---|
init() | void | Schedule a new overflow measurement. |
Migration notes
The full text DOM is retained and clipped by height rather than truncating strings. No HTML is injected. Content, width and font changes trigger measurement; the toggle is keyboard accessible.
