Atlas is deprecated. Use AI Kit for any new Atlas experiences.
- Implementation
- ChatComposerRich API
Common Examples
import { ChatComposerRich } from "@servicetitan/anvil2-ext-atlas";
function BasicComposer() {
const [message, setMessage] = useState("");
const handleSend = (text: string) => {
console.log("Sending:", text);
};
return (
<ChatComposerRich
message={message}
onChange={setMessage}
onSend={handleSend}
/>
);
}
With Action Menu
Enable file upload and voice dictation options:import { ChatComposerRich } from "@servicetitan/anvil2-ext-atlas";
function ComposerWithActions() {
const [message, setMessage] = useState("");
return (
<ChatComposerRich
message={message}
onChange={setMessage}
onSend={handleSend}
onUploadFile={() => openFileDialog()}
onDictateMessage={() => startVoiceRecognition()}
/>
);
}
Disabled State
Disable input during processing:import { ChatComposerRich } from "@servicetitan/anvil2-ext-atlas";
function DisabledComposer() {
const [isProcessing, setIsProcessing] = useState(false);
return (
<ChatComposerRich
message=""
onChange={() => {}}
onSend={handleSend}
disabled={isProcessing}
placeholder="Processing your request..."
/>
);
}
Custom Placeholder
import { ChatComposerRich } from "@servicetitan/anvil2-ext-atlas";
function CustomPlaceholderComposer() {
return (
<ChatComposerRich
message=""
onChange={setMessage}
onSend={handleSend}
placeholder="Type your question here..."
/>
);
}