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

# Chat Window – Code

> ChatWindow is the main container for the Atlas chat experience with animations and positioning.

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

> [tab] Implementation
>
> ext-atlas-chat-window-demo
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ext-atlas-chat-window-demo?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { ChatWindow } from "@servicetitan/anvil2-ext-atlas";
> import { Flex, Text } from "@servicetitan/anvil2";
>
> function App() {
>   return (
>     <ChatWindow open={true} fullscreen={false} position={{ x: 40, y: 40 }}>
>       <Flex direction="column" style={{ height: "100%", padding: "1rem" }}>
>         <Text>Chat content goes here</Text>
>       </Flex>
>     </ChatWindow>
>   );
> }
>
> export default App;
> ```
>
> ## Common Examples
>
> ```tsx theme={null}
> import { ChatWindow } from "@servicetitan/anvil2-ext-atlas";
>
> function BasicChatWindow() {
>   const [open, setOpen] = useState(false);
>
>   return (
>     <ChatWindow open={open}>
>       {/* Header, Content, Footer components */}
>     </ChatWindow>
>   );
> }
> ```
>
> ### With Position
>
> Use the `position` prop to create a floating chat window at specific coordinates:
>
> ```tsx theme={null}
> import { ChatWindow } from "@servicetitan/anvil2-ext-atlas";
>
> function PositionedChatWindow() {
>   const [open, setOpen] = useState(true);
>
>   return (
>     <ChatWindow 
>       open={open} 
>       position={{ x: 100, y: 64 }}
>     >
>       {/* Chat content */}
>     </ChatWindow>
>   );
> }
> ```
>
> ### Draggable Window
>
> Combine with the `useDraggable` hook to create a draggable chat window:
>
> ```tsx theme={null}
> import { ChatWindow, Header, useDraggable } from "@servicetitan/anvil2-ext-atlas";
>
> function DraggableChatWindow() {
>   const [open, setOpen] = useState(true);
>   const { position, isDragging, handleMouseDown, resetPosition } = useDraggable();
>
>   return (
>     <ChatWindow 
>       open={open} 
>       position={position} 
>       isDragging={isDragging}
>     >
>       <Header
>         title="Atlas"
>         isDraggable
>         isDragging={isDragging}
>         onMouseDown={handleMouseDown}
>         onClose={() => setOpen(false)}
>       />
>       {/* Content and Footer */}
>     </ChatWindow>
>   );
> }
> ```
>
> ### Fullscreen Mode
>
> Enable fullscreen mode for an expanded chat experience:
>
> ```tsx theme={null}
> import { ChatWindow } from "@servicetitan/anvil2-ext-atlas";
>
> function FullscreenChatWindow() {
>   const [open, setOpen] = useState(true);
>   const [fullscreen, setFullscreen] = useState(false);
>
>   return (
>     <ChatWindow 
>       open={open} 
>       fullscreen={fullscreen}
>     >
>       <Header
>         title="Atlas"
>         isExpanded={fullscreen}
>         onFullscreen={() => setFullscreen(!fullscreen)}
>         onClose={() => setOpen(false)}
>       />
>       {/* Content and Footer */}
>     </ChatWindow>
>   );
> }
> ```

> [tab] ChatWindow API
>
> ```tsx theme={null}
> <ChatWindow
>   open={true}
>   position={{ x: 100, y: 64 }}
>   isDragging={false}
>   fullscreen={false}
> >
>   {children}
> </ChatWindow>
> ```
>
> ## `ChatWindow` Props
>
> **children** `ReactNode` *required*
>
> The content to render inside the chat window, typically Header, Content, and Footer components.
>
> **open** `boolean` *required*
>
> Controls whether the chat window is visible. Triggers open/close animations.
>
> **fullscreen** `boolean` (default: false)
>
> When true, the window expands to fill the available space with a fade animation instead of the standard slide animation.
>
> **isDragging** `boolean` (default: false)
>
> Indicates if the window is currently being dragged. When true, layout animations are disabled to prevent conflicts.
>
> **position** `\{ x: number; y: number \}`
>
> Optional coordinates for positioning the chat window. When provided, the window uses absolute positioning.


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