Skip to main content

VibeArtifact

VibeArtifact combines the Artifact container from AI Elements SDK with VibeFrame to create a complete component display experience. It includes Run, Copy, Regenerate, Download, Share actions and a Code/Preview toggle—everything users expect when interacting with generated components.

Basic Usage

This renders:

Props

Action Buttons

Built-in Actions

Handling Actions

View Modes

Preview Mode (Default)

Shows the rendered component in a VibeFrame:

Code Mode

Shows the raw code with syntax highlighting:
Users can toggle between modes using the Code/Preview button.

Timestamps

Show when the component was last updated:
The timestamp automatically formats as:
  • “just now” (< 1 minute)
  • “X minutes ago” (< 1 hour)
  • “X hours ago” (< 1 day)
  • “X days ago” (< 1 week)
  • Full date (> 1 week)

Composition with Artifact Primitives

VibeArtifact is built on the Artifact primitives. For custom layouts, use them directly:

Artifact Primitives

Artifact

Main container with border and shadow:

ArtifactHeader

Header with title and actions:

ArtifactAction

Action button with optional tooltip:

ArtifactContent

Scrollable content area:

ArtifactClose

Close button (for modal/panel usage):

Styling

VibeArtifact uses Tailwind CSS and respects your theme:

Example: Full Studio Integration

Next Steps

VibeFrame

Learn about the secure rendering engine

Storage

Persist components to your database