- Implementation
- ArtifactPanel API
Common Examples
ArtifactPanel reads its responsive mode (inline vs. overlay) from the surrounding ArtifactPanelLayout. Wrap chat content and any artifact panels in ArtifactPanelLayout so the panel can switch modes when the available width changes. Outside a layout the panel falls back to inline mode.Basic Usage
Wrap chat content and the panel inArtifactPanelLayout. Open and close the panel from consumer state:Swapping Artifacts While Open
PasstriggerKey so the panel treats a value change as a new open event — focus shifts into the panel for the new artifact, and close-restore returns focus to the most recent trigger:Agent-Initiated Open
For panels opened by the agent rather than a user gesture, setfocusOnOpen to false so focus is not pulled away from the chat composer:React Accessibility
- The panel renders an
<aside>landmark witharia-labelledbytied to the title andaria-describedbytied to the description when present. - Focus moves into the panel on open (default behavior) and returns to the previously focused element on close.
- Slide and fade animations respect
prefers-reduced-motion. - The panel is not modal — chat content remains interactive while the panel is open. The panel does not handle Escape or click-outside; those belong to the parent chat.
- When
ArtifactPanelLayoutswitches the panel from inline to overlay mode at narrow widths, the chat content beneath remains in the document flow and reachable by assistive technology.