Skip to content
caliper ui pro docs

AI artifact

A side panel that shows a generated document or code, with copy and versions.

Pro

Onboarding checklist

Document · Version 3

Onboarding checklist

  1. Create your workspace
  2. Invite two teammates
  3. Connect a data source
  4. Build your first dashboard
  5. Turn on weekly email digests

When to use

  • An assistant produces something the user keeps working on.
  • You want the result separate from the chat.

When not to use

  • The reply is short; keep it in the message.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/ai-artifact

Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

AiArtifact

6 props
PropTypeDefaultDescription
title *string—
kind *string—For example "Document" or "Component".
versions *readonly ArtifactVersion[]—
onRestore((id: string) => void)—Called with the version to restore, which becomes a new latest version in your data.
filenamestring"artifact.txt"
classNamestring—

Keyboard

Escape
Closes or cancels, then returns focus to where it came from.

Accessibility

It exposes tablist, tab, menu, menuitemradio, status and tabpanel semantics, with aria-label, aria-selected, aria-checked, aria-haspopup, aria-expanded and aria-hidden kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/ai-artifact.md

The index of every part is at /llms.txt.

More in Knowledge