Installation
Setup
Wrap your app withArtifactuseProvider:
Syntax Highlighting (Optional)
For code syntax highlighting, add Prism.js:Components
ArtifactuseAgentMessage
Render AI messages with artifact detection
ArtifactusePanel
Side panel for previews and code
ArtifactusePanelToggle
Toggle button with badge
Quick Reference
Hooks
useArtifactuse
Access Artifactuse state and methods:Events
| Event | Payload | Description |
|---|---|---|
ai:request | { prompt, context, requestId } | AI assistance requested |
save:request | { artifactId, data } | Save requested |
export:complete | { artifactId, blob, filename } | Export completed |
form:submit | { formId, action, values } | Form submitted |
form:cancel | { formId } | Form cancelled |
social:copy | { platform, text } | Social text copied |
media:open | { type, src, alt, caption } | Media opened in lightbox |