Skip to Content
zjkm-ui-ai-elements

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.

Loading preview…

Installation

npm i zjkm-ui-ai-elements
import {  Artifact,  ArtifactHeader,  ArtifactClose,  ArtifactTitle,  ArtifactDescription,  ArtifactActions,  ArtifactAction,  ArtifactContent,} from "zjkm-ui-ai-elements/artifact";

First time? Add the package's styles: see Setup.

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

Loading preview…

Props

<Artifact />

Prop

Type

<ArtifactHeader />

Prop

Type

<ArtifactTitle />

Prop

Type

<ArtifactDescription />

Prop

Type

<ArtifactActions />

Prop

Type

<ArtifactAction />

Prop

Type

<ArtifactClose />

Prop

Type

<ArtifactContent />

Prop

Type

On this page