Generation CardPRO
The card an assistant returns for an image prompt: image, prompt, settings and actions.
Code
2 files · 411 lines of TypeScriptPRO
Generation Card is part of Pro
Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.
Motion notes
- The image arrives in three layers: opacity on a tween, blur clearing a little slower, and scale settling on the emphasis spring, so it lands rather than pops.
- The prompt is measured, not line-clamped, so expanding springs the real height open and the toggle only appears when the text actually overflows.
- Each action answers with its own small gesture: Upscale swells, Vary turns, Download drops, Copy swaps to a check.
- Actions stay disabled and dimmed until the image is ready. With reduced motion the image cross-fades and the gestures are dropped.
Usage
Example
<GenerationCard
prompt={job.prompt}
src={job.url}
status={job.done ? "ready" : "generating"}
model="Thinking Image 2"
aspectRatio="3:4"
seed={job.seed}
steps={30}
onUpscale={() => upscale(job.id)}
onVary={() => vary(job.id)}
onDownload={() => download(job.url)}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| prompt | string | — | The prompt that made the image. |
| src | string | — | Image URL. |
| alt | string | — | Alt text. Defaults to the prompt. |
| status | "generating" | "ready" | "ready" | Shows a shimmering placeholder while generating. |
| model | string | — | Model name chip. |
| aspectRatio | string | "1:1" | "w:h". Sets the image frame and shows as a chip. |
| seed | number | string | — | Seed chip. |
| steps | number | — | Sampling steps chip. |
| expanded | boolean | — | Controlled prompt expansion. |
| defaultExpanded | boolean | false | Start with the full prompt shown. |
| onExpandedChange | (expanded: boolean) => void | — | Called when the prompt toggles. |
| onUpscale | () => void | — | Upscale action. |
| onVary | () => void | — | Vary action. |
| onDownload | () => void | — | Download action. |
| onCopyPrompt | (prompt: string) => void | — | Called after the prompt is copied to the clipboard. |
| className | string | — | Size it here; the default is w-80. |