Artifact
What the agent made, as a card in the chat. Open it and the same object grows into the pane, leaving its imprint in the chat; drag the version scrubber and the document changes under your thumb.
npx shadcn@latest add @captain/artifactRewrite the pricing copy around spend caps. Keep it under 80 words.
I led with the cap and added what happens when an agent hits it. Three versions, the last with your edits.
Pricing page copy
v3, 09:40. Your edits applied
Pay for seats, never for surprises
Start free with up to 3 agents. Team is $24 per seat each month, billed yearly, and every agent has a daily spend cap you set. When an agent reaches it, it stops and asks you.
Team includes unlimited runs, review before merge and priority support. A team of 5 pays $1,440 a year.
Artifact is a Pro component
The demo and the docs are free. The source comes with Pro, through this page, the shadcn CLI and the MCP.
Usage
import { Artifact } from "@/components/ui/artifact"
<div className="relative h-full"> {/* the chat pane */}
<Artifact title="Pricing page copy" meta="Doc, 60 words" versions={versions} />
</div>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| title | string | The artifact's name. | |
| meta | string | Kind and size, e.g. Doc, 60 words. | |
| versions | ArtifactVersion[] | { label, when, note, content }. The last one opens first. | |
| icon | IconName | "file" | Leading glyph in a well. |
| open / defaultOpen | boolean | Expanded state. Pair open with onOpenChange. | |
| panelClassName | string | "inset-3" | Where the open document sits in the positioned parent, e.g. a right-hand pane beside the chat. |
| modal | boolean | true | false opens it as a side pane: no scrim, and the chat stays usable. |
| <ins> in content | element | Marks what changed in a version; shown as a soft accent tint. |
Keyboard
- Enter
- Open
- Esc
- Close and return focus to the card
- ← → on the scrubber
- Previous or next version
Accessibility
- The card is a button with aria-haspopup=dialog; the panel is a labelled dialog, modal unless modal={false}.
- Focus moves to Close when someone opens it and back to the card on close; opening by default never steals focus on load.
- The scrubber is a slider whose value text names the version and its time.
- It fills its nearest positioned parent, so give the chat pane position: relative.