> ## 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.

# Header – Code

> Header provides navigation and action controls for the Atlas chat window.

> [!WARNING]
>
> Atlas is deprecated. Use [AI Kit](https://anvil.servicetitan.com/docs/building-agentic-experiences) for any new Atlas experiences.

> [tab] Implementation
>
> ext-atlas-header-demo
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ext-atlas-header-demo?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { Header } from "@servicetitan/anvil2-ext-atlas";
> import { Card } from "@servicetitan/anvil2";
>
> function App() {
>   return (
>     <Card
>       flexDirection="column"
>       gap={4}
>       background="strong"
>       padding="0"
>       style={{ width: "388px" }}
>     >
>       <Header
>         title="Atlas"
>         onBack={() => console.log("back clicked")}
>         onClose={() => console.log("close clicked")}
>         onViewHistory={() => console.log("view history clicked")}
>         onFullscreen={() => console.log("fullscreen clicked")}
>         onCreateNewChat={() => console.log("new chat clicked")}
>       />
>     </Card>
>   );
> }
>
> export default App;
> ```
>
> ## Common Examples
>
> ```tsx theme={null}
> 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:
>
> ```tsx theme={null}
> 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:
>
> ```tsx theme={null}
> 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:
>
> ```tsx theme={null}
> 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:
>
> ```tsx theme={null}
> 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()}
>     />
>   );
> }
> ```

> [tab] Header API
>
> ```tsx theme={null}
> <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
>
> **className** `string`
>
> Additional CSS class name for custom styling.
>
> **disabledChatsIcon** `boolean`
>
> Disables the chat history button.
>
> **historyCount** `number`
>
> Number to display in the history button badge.
>
> **isDraggable** `boolean`
>
> When true, displays the drag handle for repositioning the window.
>
> **isDragging** `boolean`
>
> Indicates if the window is currently being dragged. Changes cursor to grabbing.
>
> **isExpanded** `boolean`
>
> Indicates fullscreen mode. Hides the drag handle and changes fullscreen tooltip.
>
> **onBack** `() =\> void`
>
> Handler for back button click. Button only renders when provided.
>
> **onClose** `() =\> void`
>
> Handler for close button click. Button only renders when provided.
>
> **onCreateNewChat** `() =\> void`
>
> Handler for new chat button click. Button only renders when provided.
>
> **onFullscreen** `() =\> void`
>
> Handler for fullscreen button click. Button only renders when provided.
>
> **onMouseDown** `(e: MouseEvent) =\> void`
>
> Handler for drag start. Required when `isDraggable` is true.
>
> **onViewHistory** `() =\> void`
>
> Handler for history button click. Button only renders when provided.
>
> **title** `string` (default: Atlas)
>
> The title displayed in the header.
>
> **titleBadge** `string | number`
>
> Badge content to display next to the title.
>
> ### Test ID Props
>
> **backButtonId** `string`
>
> Test ID for the back button.
>
> **closeButtonId** `string`
>
> Test ID for the close button.
>
> **fullscreenButtonId** `string`
>
> Test ID for the fullscreen button.
>
> **newChatButtonId** `string`
>
> Test ID for the new chat button.
>
> **viewHistoryButtonId** `string`
>
> Test ID for the history button.


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