• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
drewmcdonald

drewmcdonald

promptCompare

Public
Like
promptCompare
Home
Code
7
.claude
3
backend
2
docs
1
frontend
4
shared
.mcp.json
deno.json
Environment variables
2
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
.claude
/
skills
/
ai-elements
/
references
/
artifact.md
Code
/
.claude
/
skills
/
ai-elements
/
references
/
artifact.md
Search
…
Viewing readonly version of main branch: v100
View latest version
artifact.md

Artifact

A container component for displaying generated content like code, documents, or other outputs with built-in actions.

The Artifact component provides a structured container for displaying generated content like code, documents, or other outputs with built-in header actions.

See scripts/artifact.tsx for this example.

Installation

npx ai-elements@latest add artifact

Features

  • Structured container with header and content areas
  • Built-in header with title and description support
  • Flexible action buttons with tooltips
  • Customizable styling for all subcomponents
  • Support for close buttons and action groups
  • Clean, modern design with border and shadow
  • Responsive layout that adapts to content
  • TypeScript support with proper type definitions
  • Composable architecture for maximum flexibility

Examples

With Code Display

See scripts/artifact.tsx for this example.

Props

<Artifact />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Any other props are spread to the underlying div element.

<ArtifactHeader />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Any other props are spread to the underlying div element.

<ArtifactTitle />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLParagraphElement>-Any other props are spread to the underlying paragraph element.

<ArtifactDescription />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLParagraphElement>-Any other props are spread to the underlying paragraph element.

<ArtifactActions />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Any other props are spread to the underlying div element.

<ArtifactAction />

PropTypeDefaultDescription
tooltipstring-Tooltip text to display on hover.
labelstring-Screen reader label for the action button.
iconLucideIcon-Lucide icon component to display in the button.
...propsReact.ComponentProps<typeof Button>-Any other props are spread to the underlying shadcn/ui Button component.

<ArtifactClose />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof Button>-Any other props are spread to the underlying shadcn/ui Button component.

<ArtifactContent />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Any other props are spread to the underlying div element.
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.