Wrap the title of a section. It unfolds as the reader scrolls it into view.
The sample also uses Badge and Button. One command adds them with this item:
chapter-section.tsx
TextFold
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | — | The text. It folds as one sheet of paper, across all its lines. |
| slats | number | 4 | How many bands the sheet folds into, from 2 to 12. Default 4. |
| angle | number | 80 | The turn of each band when folded, in degrees (90 is edge on). Default 80. |
| perspective | number | 800 | The 3D view distance in px. Smaller is stronger. Default 800. |
| trigger | "mount""scroll""view" | "scroll" | What unfolds it: scroll (default) the scroll place of the text, view one unfold the first time it is on screen, mount one unfold at once. |
| range | readonly [number, number] | DEFAULT_RANGE | With trigger scroll: where the unfold starts and ends, as shares of the view height from its top. Default [1, 0.6]: it starts to open when the top of the text is at the bottom edge of the view, and it is flat when the middle of the text is at 60%. When the page cannot scroll that far (the text is near the end of the page), it is flat at the end of the scroll. |
| container | RefObject<HTMLElement | null> | — | With trigger scroll: the scroll box, when the text scrolls inside one. |
| refold | number | 0 | How far the sheet folds again while the mouse is on it, or while keyboard focus is on it or on an element around it, from 0 (off, default) to 1 (fully). |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
| Tab | While keyboard focus is on the link or button around the text, it folds again by refold, as the mouse would fold it. |
|---|









