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.
ChatWindow is the main container for the Atlas chat experience with animations and positioning.
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.
import { ChatWindow } from "@servicetitan/anvil2-ext-atlas";
function BasicChatWindow() {
const [open, setOpen] = useState(false);
return (
<ChatWindow open={open}>
{/* Header, Content, Footer components */}
</ChatWindow>
);
}
position prop to create a floating chat window at specific coordinates: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>
);
}
useDraggable hook to create a draggable chat window: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>
);
}
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>
);
}
<ChatWindow
open={true}
position={{ x: 100, y: 64 }}
isDragging={false}
fullscreen={false}
>
{children}
</ChatWindow>
ChatWindow PropsWas this page helpful?