ExpandableText
Long text clamped to a few lines, with More to open the rest.
import { ExpandableText } from '@iffday/web/src/kit';Example
Long text shows lines lines first, six by default, followed by More in red. When the text fits, More does not appear: the component measures the text once and again whenever its width changes. Opened, the link becomes Less.
import { ExpandableText } from '@iffday/web/src/kit';
import { longText } from '../../../samples';
export default function Example() {
return (
<div style={{ width: 'min(100%, 520px)' }}>
<ExpandableText lines={3}>
<p>{longText}</p>
</ExpandableText>
</div>
);
}Props
ExpandableText
apps/web/src/kit.tsx:292Clamp long text with record.club's inline MORE.
| Prop | Type | Default |
|---|---|---|
children* | ReactNode | |
lines | number | 6 |
className | string | '' |