- Implementation
- Header API
Common Examples
Copy
Ask AI
import { Header } from "@servicetitan/ext-atlas";
function BasicHeader() {
return (
<Header
title="Atlas"
onClose={() => console.log("Close clicked")}
/>
);
}
With All Actions
Enable all available header actions:Copy
Ask AI
import { Header } from "@servicetitan/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:Copy
Ask AI
import { Header, useDraggable } from "@servicetitan/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:Copy
Ask AI
import { Header } from "@servicetitan/ext-atlas";
function HeaderWithBadge() {
return (
<Header
title="Atlas"
titleBadge="Beta"
onClose={() => closeWindow()}
/>
);
}
Expanded State
In fullscreen mode, the drag handle is hidden:Copy
Ask AI
import { Header } from "@servicetitan/ext-atlas";
function ExpandedHeader() {
const [isExpanded, setIsExpanded] = useState(false);
return (
<Header
title="Atlas"
isExpanded={isExpanded}
onFullscreen={() => setIsExpanded(!isExpanded)}
onClose={() => closeWindow()}
/>
);
}
Copy
Ask AI
<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}
/>
Header Props
Additional CSS class name for custom styling.
Disables the chat history button.
Number to display in the history button badge.
When true, displays the drag handle for repositioning the window.
Indicates if the window is currently being dragged. Changes cursor to grabbing.
Indicates fullscreen mode. Hides the drag handle and changes fullscreen tooltip.
Handler for back button click. Button only renders when provided.
Handler for close button click. Button only renders when provided.
Handler for new chat button click. Button only renders when provided.
Handler for fullscreen button click. Button only renders when provided.
Handler for drag start. Required when
isDraggable is true.Handler for history button click. Button only renders when provided.
The title displayed in the header.
Badge content to display next to the title.
Test ID Props
Test ID for the back button.
Test ID for the close button.
Test ID for the fullscreen button.
Test ID for the new chat button.
Test ID for the history button.
