Import
- Vue 3
- Vue 2
- React
- Svelte
Usage
- Vue
- React
- Svelte
Layout
The panel should be a sibling to your chat container in a flex layout:Events
| Event | Payload | Description |
|---|---|---|
ai-request | { prompt, context, requestId } | AI assistance requested from panel (e.g., “Fix this code”) |
save | { artifactId, data } | Save requested for current artifact |
export | { artifactId, blob, filename } | Export completed |
form-submit | { formId, action, values } | Panel form submitted |
Handling AI Requests
When users request AI assistance from the panel (e.g., clicking “Fix”, “Improve”, or using the AI input), handle it like this:- Vue
- React
View Modes
The panel supports three view modes:| Mode | Description |
|---|---|
preview | Live preview of the artifact (default for HTML, React, Vue) |
code | Syntax-highlighted code view |
split | Side-by-side preview and code |
Fullscreen
Toggle fullscreen mode:Panel Controls
The panel header includes:- View mode tabs - Switch between preview/code/split
- Fullscreen button - Expand to full screen
- Close button - Close the panel
- Branding - “Powered by Artifactuse” (can be hidden with license)
- Navigation - Previous/next artifact buttons
- Actions - Copy, download, export buttons
Artifact Navigation
When multiple artifacts exist, users can navigate between them using the footer controls or programmatically:Mobile Behavior
On mobile devices (< 768px), the panel:- Opens as a full-screen overlay
- Hides the resize handle
- Shows a backdrop behind the panel
- Uses vertical split in split mode
Vue 2 Portal
For Vue 2, the panel usesportal-vue for fullscreen/mobile rendering. Add the portal target: