Atlas is deprecated. Use AI Kit for any new Atlas experiences.
- Implementation
- Header API
Common Examples
import { Header } from "@servicetitan/anvil2-ext-atlas";
function BasicHeader() {
return (
<Header
title="Atlas"
onClose={() => console.log("Close clicked")}
/>
);
}
With All Actions
Enable all available header actions:import { Header } from "@servicetitan/anvil2-ext-atlas";
function FullHeader() {
return (
<Header
title="Atlas"
onBack={() => navigateBack()}
onViewHistory={() => openHistory()}
onFullscreen={() => toggleFullscreen()}
onCreateNewChat={() => startNewChat()}
onClose={() => closeWindow()}
historyCount={5}
/>
);
}
Draggable Header
Enable the drag handle for repositioning the chat window:import { Header, useDraggable } from "@servicetitan/anvil2-ext-atlas";
function DraggableHeader() {
const { isDragging, handleMouseDown } = useDraggable();
return (
<Header
title="Atlas"
isDraggable
isDragging={isDragging}
onMouseDown={handleMouseDown}
onClose={() => closeWindow()}
/>
);
}
With Title Badge
Display a badge next to the title:import { Header } from "@servicetitan/anvil2-ext-atlas";
function HeaderWithBadge() {
return (
<Header
title="Atlas"
titleBadge="Beta"
onClose={() => closeWindow()}
/>
);
}
Expanded State
In fullscreen mode, the drag handle is hidden:import { Header } from "@servicetitan/anvil2-ext-atlas";
function ExpandedHeader() {
const [isExpanded, setIsExpanded] = useState(false);
return (
<Header
title="Atlas"
isExpanded={isExpanded}
onFullscreen={() => setIsExpanded(!isExpanded)}
onClose={() => closeWindow()}
/>
);
}
<Header
title="Atlas"
isDraggable={true}
isDragging={false}
isExpanded={false}
historyCount={5}
titleBadge="Beta"
onMouseDown={handleMouseDown}
onBack={handleBack}
onClose={handleClose}
onViewHistory={handleHistory}
onFullscreen={handleFullscreen}
onCreateNewChat={handleNewChat}
/>