> ## Documentation Index
> Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Artifact Card - Web

> Artifact cards present Atlas-generated content as a compact, actionable row in the chat transcript.

> [!NOTE]
>
> For development, import `ArtifactCard` from
> `@servicetitan/anvil2-ai-kit`. For design, find it in the
> [AI Kit Web Component Library file](https://www.figma.com/design/QEIsArLktLeJAaFvcpw3PO/AI-Kit-Web-Component-Library).

ai-kit-artifact-card

[StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card?file=src/App.tsx)

```tsx lines theme={null}
import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";

function App() {
  return (
    <div style={{ maxWidth: "33rem" }}>
      <ArtifactCard
        artifactType="document"
        title="Service agreement summary"
        description="Key terms and signatures extracted from the contract."
        onPress={() => {}}
      />
    </div>
  );
}

export default App;
```

ArtifactCard surfaces content Atlas generated during the conversation — never content the user retrieved or uploaded themselves. It lives in the chat transcript only, never inside the artifact panel: pressing it either opens the panel to reveal the full result, or downloads the artifact directly, depending on what it represents. Don't use it as a collapsible card inside the artifact panel.

## Options

The Artifact Card supports an icon and an optional description.

### Icon

ai-kit-artifact-card-icon

[StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card-icon?file=src/App.tsx)

```tsx lines theme={null}
import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";

function App() {
  return (
    <div
      style={{
        display: "flex",
        flexDirection: "column",
        gap: 12,
        maxWidth: "33rem",
      }}
    >
      {/* With icon */}
      <ArtifactCard
        artifactType="document"
        title="Service agreement summary"
        description="Key terms and signatures extracted from the contract."
        onPress={() => {}}
      />

      {/* Without icon */}
      <ArtifactCard
        title="Service agreement summary"
        description="Key terms and signatures extracted from the contract."
        onPress={() => {}}
      />
    </div>
  );
}

export default App;
```

The icon is a decorative avatar that signals the kind of artifact the card represents. `artifactType` only accepts `document` for the time being — the prop stays in place so more kinds can be added later without a breaking change. Omitting `artifactType` renders the card without an icon — title and description only.

### Description

ai-kit-artifact-card-description

[StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card-description?file=src/App.tsx)

```tsx lines theme={null}
import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";

function App() {
  return (
    <div
      style={{
        display: "flex",
        flexDirection: "column",
        gap: 12,
        maxWidth: "33rem",
      }}
    >
      {/* With description */}
      <ArtifactCard
        artifactType="document"
        title="Service agreement summary"
        description="Key terms and signatures extracted from the contract."
        onPress={() => {}}
      />

      {/* Without description */}
      <ArtifactCard
        artifactType="document"
        title="Service agreement summary"
        onPress={() => {}}
      />
    </div>
  );
}

export default App;
```

An optional description renders beneath the title as compact body text, providing supporting context about the artifact's content.

## Behavior

The entire card surface is a single button. Padding, the trailing caret, and interactivity are fixed and not configurable.

### Visual States

ai-kit-artifact-card-visual-states

[StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card-visual-states?file=src/App.tsx)

```tsx lines theme={null}
import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";

function App() {
  return (
    <div
      style={{
        display: "flex",
        flexDirection: "column",
        gap: 12,
        maxWidth: "33rem",
      }}
    >
      {/* Rest */}
      <ArtifactCard
        artifactType="document"
        title="Service agreement summary"
        description="Key terms and signatures extracted from the contract."
        onPress={() => {}}
      />

      {/* Hover */}
      <ArtifactCard
        artifactType="document"
        title="Service agreement summary"
        description="Key terms and signatures extracted from the contract."
        onPress={() => {}}
      />

      {/* Focus */}
      <ArtifactCard
        artifactType="document"
        title="Service agreement summary"
        description="Key terms and signatures extracted from the contract."
        onPress={() => {}}
      />
    </div>
  );
}

export default App;
```

The card responds to hover, focus, and press with a surface elevation change inherited from the Card component. The focus ring appears on keyboard navigation.

### Overflow

ai-kit-artifact-card-overflow

[StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card-overflow?file=src/App.tsx)

```tsx lines theme={null}
import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";

function App() {
  return (
    <div style={{ maxWidth: "33rem" }}>
      <ArtifactCard
        artifactType="document"
        title="Comprehensive service agreement summary across every clause and amendment"
        description="Key terms, signatures, adjuster notes, and the full history of Atlas's edits to this contract over the past two weeks."
        onPress={() => {}}
      />
    </div>
  );
}

export default App;
```

Long titles and descriptions wrap within the card's content column. The caret stays aligned to the top of the content area.

## Usage Guidelines

### When to Use

Use the Artifact Card when:

* **Generated results in the transcript** – Atlas generated content during the conversation, and the chat transcript needs a compact entry point to it.
* **Opening or downloading a result** – Pressing the card opens the full result in the artifact panel or downloads the artifact, depending on what it represents.

### When not to use

Avoid using the Artifact Card for:

* **Content the user retrieved or uploaded** – The Artifact Card represents only content Atlas generated. Show an attachment the user sends with the [User Media Message](https://anvil.servicetitan.com/docs/components/user-media-message/web.md).
* **Content inside the artifact panel** – The Artifact Card lives in the chat transcript only. Use a [Tabbed Layout](https://anvil.servicetitan.com/docs/components/tabbed-layout/web.md) to organize multiple related views inside the panel.

## Keyboard Interaction

Users can navigate and activate the Artifact Card using standard keyboard controls.

| Key | Description |
| - | - |
| Tab | Moves focus to the card button |
| Enter / Space | Activates the focused card and fires `onPress` |

## Code

> [tab] Implementation
>
> ai-kit-artifact-card
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";
>
> function App() {
>   return (
>     <div style={{ maxWidth: "33rem" }}>
>       <ArtifactCard
>         artifactType="document"
>         title="Service agreement summary"
>         description="Key terms and signatures extracted from the contract."
>         onPress={() => {}}
>       />
>     </div>
>   );
> }
>
> export default App;
> ```
>
> ## Common Examples
>
> To use the `ArtifactCard`, pass a required `title` and `onPress` handler. The whole surface is a button, and the title is its accessible name.
>
> ```tsx theme={null}
> import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";
>
> function ExampleComponent() {
>   return (
>     <ArtifactCard
>       artifactType="invoice"
>       title="Insights for Invoice #37482915"
>       description="Line items, customer details, and proposed edits."
>       onPress={openArtifact}
>     />
>   );
> }
> ```
>
> ### Artifact type
>
> `artifactType` selects a decorative icon for `"invoice"`, `"message"`, or `"document"`. Omit it to render no leading icon.
>
> ai-kit-artifact-card-icon
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card-icon?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";
>
> function App() {
>   return (
>     <div
>       style={{
>         display: "flex",
>         flexDirection: "column",
>         gap: 12,
>         maxWidth: "33rem",
>       }}
>     >
>       {/* With icon */}
>       <ArtifactCard
>         artifactType="document"
>         title="Service agreement summary"
>         description="Key terms and signatures extracted from the contract."
>         onPress={() => {}}
>       />
>
>       {/* Without icon */}
>       <ArtifactCard
>         title="Service agreement summary"
>         description="Key terms and signatures extracted from the contract."
>         onPress={() => {}}
>       />
>     </div>
>   );
> }
>
> export default App;
> ```
>
> ### Description
>
> Use `description` for compact supporting text. Omit it for a title-only content area.
>
> ai-kit-artifact-card-description
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card-description?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";
>
> function App() {
>   return (
>     <div
>       style={{
>         display: "flex",
>         flexDirection: "column",
>         gap: 12,
>         maxWidth: "33rem",
>       }}
>     >
>       {/* With description */}
>       <ArtifactCard
>         artifactType="document"
>         title="Service agreement summary"
>         description="Key terms and signatures extracted from the contract."
>         onPress={() => {}}
>       />
>
>       {/* Without description */}
>       <ArtifactCard
>         artifactType="document"
>         title="Service agreement summary"
>         onPress={() => {}}
>       />
>     </div>
>   );
> }
>
> export default App;
> ```
>
> ### Heading level
>
> `titleLevel` sets the semantic heading tag from `h3` through `h6` without changing the visual style. Choose the level that fits the surrounding document outline.
>
> ### Overflow
>
> Long titles and descriptions wrap inside the card.
>
> ai-kit-artifact-card-overflow
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ai-kit-artifact-card-overflow?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { ArtifactCard } from "@servicetitan/anvil2-ai-kit";
>
> function App() {
>   return (
>     <div style={{ maxWidth: "33rem" }}>
>       <ArtifactCard
>         artifactType="document"
>         title="Comprehensive service agreement summary across every clause and amendment"
>         description="Key terms, signatures, adjuster notes, and the full history of Atlas's edits to this contract over the past two weeks."
>         onPress={() => {}}
>       />
>     </div>
>   );
> }
>
> export default App;
> ```
>
> ## Internationalization
>
> `ArtifactCard` has no component-owned strings. Localize `title` and `description` before passing them to the component.
>
> ## React Accessibility
>
> * The required `title` names the whole-card button.
> * The artifact-type icon and trailing arrow are decorative.
> * Users activate the focused card with Enter or Space.
> * `titleLevel` preserves document structure independently of visual styling.

> [tab] ArtifactCard Props
>
> ```tsx theme={null}
> <ArtifactCard
>   artifactType="invoice"
>   title="Insights for Invoice #37482915"
>   description="Line items and proposed edits."
>   titleLevel={4}
>   onPress={openArtifact}
> />
> ```
>
> ## `ArtifactCard` Props
>
> The `ArtifactCard` accepts the following props.
>
> **onPress** `() =\> void` *required*
>
> Handles activation of the whole-card button.
>
> **title** `string` *required*
>
> Single-line title, semantic heading content, and accessible name.
>
> **artifactType** `"invoice" | "message" | "document"`
>
> Selects the decorative leading icon. Omit for no icon.
>
> **className** `string`
>
> Class merged onto the card surface.
>
> **description** `string`
>
> Supporting text rendered beneath the title.
>
> **titleLevel** `3 | 4 | 5 | 6` (default: 4)
>
> Semantic heading level. Visual styling remains fixed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.