KQ-2061 · PROMPT/STAMP
Prompt Stamp
One prompt with {placeholders} above a small sheet of rows; Run stamps it down the sheet. A plate carrying the prompt's tokens travels down the output column on springs.glide and presses each row on springs.recoil, its tokens turning into that row's values as the mapped cells light up left to right in a cascade, then the answer streams into the cell — and a row with an empty mapped cell is pressed too but fails with the reason instead of an invented answer. Typing { opens a column picker (arrows, Enter or Tab inserts), the sheet is a grid with one roving cell where Enter edits a field and retries or expands an answer, and at phone width each row becomes a card.
Shop descriptions
6 rows · 4 fields
Type { to add a column · ⌘↵ runs
Arrow keys move between cells. Enter edits a field; on an answer, Enter expands it or retries a failed row.
6 rows · ready to stamp · coldbrook shop
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/prompt-stamp
Props
- stampSpeed
- number
- default 1
- How fast the stamp walks the sheet and the answers stream, as a multiplier.
- rowHeight
- number
- default 52
- Row height in px; the answer shows as many lines as fit (1 to 3), and Enter expands a row.
- accent
- string
- default "var(--accent-bright)"
- Tokens, the stamp, lit cells, Run and done checks — any CSS colour.
- template / defaultTemplate
- string
- default — / defaultPromptTemplate
- The prompt, with {placeholders} naming columns; controlled or initial.
- onTemplateChange
- (template: string) => void
- default —
- Fires from every edit and every column inserted from the picker.
- columns
- PromptStampColumn[]
- default defaultPromptStampColumns
- The sheet's input columns: id (the placeholder name), label and grow.
- rows / defaultRows
- PromptStampRow[]
- default — / defaultPromptStampRows
- The rows the prompt runs down, each with a value per column id; controlled or initial.
- onRowsChange
- (rows: PromptStampRow[]) => void
- default —
- Fires with every row after a cell is edited in place.
- mapping
- Record<string, string>
- default {}
- Placeholder names that read another column, e.g. { bean: "product" }.
- results / defaultResults
- PromptStampResults
- default — / {}
- Run state per row id (idle, queued, running, failed, done, with text and error). Controlled, the host runs the prompt and the sheet shows it.
- onResultsChange
- (results: PromptStampResults) => void
- default —
- Fires whenever the built-in run changes a row's state or text.
- respond
- (row: PromptStampRow, prompt: string) => string
- default defaultRespond
- The built-in run's answer for a row and its filled prompt.
- onRun
- (runs: PromptStampRun[]) => void
- default —
- Run was pressed: every row's filled prompt.
- onStop
- () => void
- default —
- Stop was pressed during a run.
- onRetryRow
- (rowId: string, prompt: string) => void
- default —
- Retry was pressed on a failed row.
- onExport
- (csv: string, results: PromptStampResults) => void
- default —
- Export was pressed: the sheet with its answers as CSV.
- concurrency
- number
- default 3
- Rows the built-in run works on at once.
- title
- string
- default "Shop descriptions"
- The sheet's name in the header.
- outputLabel
- string
- default "Description"
- The output column's heading.
- status
- "ready" | "loading" | "error"
- default "ready"
- Whether the rows are here: loading shows a skeleton, error a Try again.
- onReload
- () => void
- default —
- Try again was pressed after the rows failed to load.
- height
- number
- default 560
- The tallest the surface grows, px; past it the sheet scrolls inside.
- ref
- React.Ref<PromptStampHandle>
- default —
- Imperative handle with run() and stop().
- disabled
- boolean
- default false
- Nothing can be edited or run.
- className
- string
- default —
- Classes for the outer surface.
| Prop | Type | Default | Description |
|---|---|---|---|
| stampSpeed | number | 1 | How fast the stamp walks the sheet and the answers stream, as a multiplier. |
| rowHeight | number | 52 | Row height in px; the answer shows as many lines as fit (1 to 3), and Enter expands a row. |
| accent | string | "var(--accent-bright)" | Tokens, the stamp, lit cells, Run and done checks — any CSS colour. |
| template / defaultTemplate | string | — / defaultPromptTemplate | The prompt, with {placeholders} naming columns; controlled or initial. |
| onTemplateChange | (template: string) => void | — | Fires from every edit and every column inserted from the picker. |
| columns | PromptStampColumn[] | defaultPromptStampColumns | The sheet's input columns: id (the placeholder name), label and grow. |
| rows / defaultRows | PromptStampRow[] | — / defaultPromptStampRows | The rows the prompt runs down, each with a value per column id; controlled or initial. |
| onRowsChange | (rows: PromptStampRow[]) => void | — | Fires with every row after a cell is edited in place. |
| mapping | Record<string, string> | {} | Placeholder names that read another column, e.g. { bean: "product" }. |
| results / defaultResults | PromptStampResults | — / {} | Run state per row id (idle, queued, running, failed, done, with text and error). Controlled, the host runs the prompt and the sheet shows it. |
| onResultsChange | (results: PromptStampResults) => void | — | Fires whenever the built-in run changes a row's state or text. |
| respond | (row: PromptStampRow, prompt: string) => string | defaultRespond | The built-in run's answer for a row and its filled prompt. |
| onRun | (runs: PromptStampRun[]) => void | — | Run was pressed: every row's filled prompt. |
| onStop | () => void | — | Stop was pressed during a run. |
| onRetryRow | (rowId: string, prompt: string) => void | — | Retry was pressed on a failed row. |
| onExport | (csv: string, results: PromptStampResults) => void | — | Export was pressed: the sheet with its answers as CSV. |
| concurrency | number | 3 | Rows the built-in run works on at once. |
| title | string | "Shop descriptions" | The sheet's name in the header. |
| outputLabel | string | "Description" | The output column's heading. |
| status | "ready" | "loading" | "error" | "ready" | Whether the rows are here: loading shows a skeleton, error a Try again. |
| onReload | () => void | — | Try again was pressed after the rows failed to load. |
| height | number | 560 | The tallest the surface grows, px; past it the sheet scrolls inside. |
| ref | React.Ref<PromptStampHandle> | — | Imperative handle with run() and stop(). |
| disabled | boolean | false | Nothing can be edited or run. |
| className | string | — | Classes for the outer surface. |