Skip to main content

Common Examples

Basic Usage

Message action toolbar:
import { Toolbox, UserFeedback } from "@servicetitan/ext-atlas";

function MessageToolbox() {
  const [feedback, setFeedback] = useState(UserFeedback.None);

  return (
    <Toolbox
      text="Message content to copy"
      currentFeedback={feedback}
      onLike={async () => {
        await submitFeedback("positive");
        setFeedback(UserFeedback.Positive);
      }}
      onDislike={async () => {
        await submitFeedback("negative");
        setFeedback(UserFeedback.Negative);
      }}
      onRetry={async () => {
        await regenerateResponse();
      }}
    />
  );
}

With All Actions

Include all available actions:
import { Toolbox, UserFeedback } from "@servicetitan/ext-atlas";

function FullToolbox() {
  return (
    <Toolbox
      text="Message content"
      currentFeedback={UserFeedback.None}
      onLike={handleLike}
      onDislike={handleDislike}
      onRetry={handleRetry}
      onFlag={handleFlag}
      onPlay={handlePlay}
    />
  );
}

Copy Only

Simple copy functionality:
import { Toolbox } from "@servicetitan/ext-atlas";

function CopyOnlyToolbox() {
  return <Toolbox text="Content to copy" />;
}
Last modified on February 12, 2026