KQ-764 · RESULT/FOLD
Result Fold
A tool result that shows what it can and folds the rest. The first lines are always printed; everything after them lives in a tail whose height is measured by a ResizeObserver and animated on glide between zero and full, so unfolding is a surface extending and a line landing while open grows the box smoothly. A fade sits over the last preview line while folded, and when the host passes a summary a gist chip arrives beside the name from 4px on snap. The fold control names what it will do and Enter or Space presses it.
KQ-764 · RESULT/FOLD
search_ledger0 lines
No result yet.
Idle · press play
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/result-fold
Props
- name
- string
- default —
- The tool's name, printed in mono.
- text
- string
- default ""
- The result so far, one line per newline. Append-only.
- previewLines
- number
- default 3
- Lines shown while folded.
- summary
- string
- default —
- The gist; when present it arrives as a chip beside the name.
- open / defaultOpen
- boolean
- default false
- Controlled or initial unfolded state.
- onOpenChange
- (open: boolean) => void
- default —
- Fires from the fold control.
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | — | The tool's name, printed in mono. |
| text | string | "" | The result so far, one line per newline. Append-only. |
| previewLines | number | 3 | Lines shown while folded. |
| summary | string | — | The gist; when present it arrives as a chip beside the name. |
| open / defaultOpen | boolean | false | Controlled or initial unfolded state. |
| onOpenChange | (open: boolean) => void | — | Fires from the fold control. |