Skip to main content

Installation

Setup

Syntax Highlighting (Optional)

For code syntax highlighting, add Prism.js:
Or via CDN:

API

processMessage

Process AI content and extract artifacts:

openArtifact

Open an artifact in the panel:

Panel Methods

openPanel() opens the panel with no artifact selected, showing an “Artifact Viewer” header and a prompt to open an artifact. When an artifact is subsequently opened (via openArtifact(), openFile(), or openCode()), the empty state is automatically cleared.

openFile / openCode

Open artifacts programmatically without processing AI message content:

updateFile

Theme

Events

Rendering

Render to Element

Manual Rendering

State

Full Example

Configuration