- Implementation
- Suggestion API
- SuggestionList API
Common Examples
Single Suggestion
Display a single suggestion chip:Copy
Ask AI
import { Suggestion } from "@servicetitan/ext-atlas";
function SingleSuggestion() {
return (
<Suggestion
text="How do I schedule an appointment?"
onClick={(text) => sendMessage(text)}
/>
);
}
Suggestion List
Display multiple suggestions:Copy
Ask AI
import { SuggestionList } from "@servicetitan/ext-atlas";
function MultipleSuggestions() {
const suggestions = [
"How do I schedule an appointment?",
"What are your business hours?",
"Tell me about your services",
];
return (
<SuggestionList
suggestions={suggestions}
onSelect={(text) => sendMessage(text)}
/>
);
}
Dynamic Suggestions
Update suggestions based on context:Copy
Ask AI
import { SuggestionList } from "@servicetitan/ext-atlas";
function ContextualSuggestions({ topic }) {
const suggestions = useMemo(() => {
if (topic === "scheduling") {
return ["Book now", "See availability", "Reschedule"];
}
return ["Get started", "Learn more", "Contact us"];
}, [topic]);
return (
<SuggestionList
suggestions={suggestions}
onSelect={handleSelect}
/>
);
}
Copy
Ask AI
<Suggestion
text="How do I schedule?"
onClick={handleClick}
/>
Suggestion Props
Callback fired when the suggestion is clicked, receives the suggestion text.
The suggestion text to display and pass to the onClick callback.
