Skip to content
Sign upPro
ShellArtifact sheetMenu

Artifact sheet (Pro)

ProIncluded in $99

An artifact opens as a near full height sheet and the chat steps back behind it, scaled down with rounded corners.

ProTap the patch in the reply: the sheet rises and the chat steps back. Drag it down to bring the chat forward.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/artifact-sheet

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { ArtifactSheet } from "@/components/ui/chatcn/pro/artifact-sheet"

<ArtifactSheet
  open={open}
  onOpenChange={setOpen}
  title="createIntent.patch"
  subtitle="Patch · 1 file"
  icon={<FileDiffIcon />}
  actions={<CopyButton value={patch} label="Copy patch" />}
  content={<DiffViewer patch={patch} />}
  returnFocus={cardRef}
>
  <ChatScreen />   {/* the chat it covers */}
</ArtifactSheet>

Wrap the chat screen in it. When it opens, the chat scales down, drops just below the status bar and rounds its top corners over a dark backdrop, the way native apps stack a card over what opened it, so it is clear the chat is still there. The chat follows the sheet exactly: on the same spring when the sheet moves on its own, and 1:1 with the finger while it is dragged down, so pulling the sheet brings the chat forward. A flick or a pull past the threshold closes it. The header holds the artifact's name, a line under it, your actions and Close; it drags from anywhere except its buttons. The chat behind is inert while the sheet is up. In a phone frame, turn the status bar light while it is open, as the demo does.

Examples

States

ProOpen at real phone width, with a document instead of code.

Props

PropTypeNotes
open, onOpenChangebooleanControlled
title, subtitle, iconThe header
actionsReactNodeButtons before Close
contentReactNodeThe artifact
returnFocusRefObject<HTMLElement>Usually the card that opened it
childrenReactNodeThe screen behind
labelsPartial<ArtifactSheetLabels>Every string, for translation

Keyboard

KeyAction
EscapeClose; focus returns to the card
Arrow down on the grabberClose
TabStays inside the sheet

Accessibility

  • The sheet is a modal dialog named by the artifact; the chat behind is inert while it is open.
  • Close is a real button, so the gesture is never the only way out.

Motion

The sheet and the chat behind move together on a critically damped spring over about 520 ms; the chat scales to 92% and rounds its corners with clip-path. Under reduced motion the sheet slides in 150 ms and the chat does not scale.