Skip to main content

Common Examples

import { ChatWindow } from "@servicetitan/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:
import { ChatWindow } from "@servicetitan/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:
import { ChatWindow, Header, useDraggable } from "@servicetitan/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:
import { ChatWindow } from "@servicetitan/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>
  );
}
Last modified on February 12, 2026