Atlas is deprecated. Use AI Kit for any new Atlas experiences.
- Implementation
- Footer API
Common Examples
import { Footer } from "@servicetitan/anvil2-ext-atlas";
function BasicFooter() {
const [message, setMessage] = useState("");
const handleSubmit = () => {
console.log("Sending:", message);
setMessage("");
};
return (
<Footer
message={message}
onMessageChange={setMessage}
onSubmit={handleSubmit}
/>
);
}
With Loading State
Disable input during message processing:import { Footer } from "@servicetitan/anvil2-ext-atlas";
function FooterWithLoading() {
const [message, setMessage] = useState("");
const [isLoading, setIsLoading] = useState(false);
const handleSubmit = async () => {
setIsLoading(true);
await sendMessage(message);
setMessage("");
setIsLoading(false);
};
return (
<Footer
message={message}
onMessageChange={setMessage}
onSubmit={handleSubmit}
isLoading={isLoading}
/>
);
}
With Additional Actions
Enable file upload and voice dictation:import { Footer } from "@servicetitan/anvil2-ext-atlas";
function FooterWithActions() {
const [message, setMessage] = useState("");
return (
<Footer
message={message}
onMessageChange={setMessage}
onSubmit={handleSubmit}
onUploadFile={() => openFileDialog()}
onDictateMessage={() => startVoiceInput()}
/>
);
}
Custom Placeholder
import { Footer } from "@servicetitan/anvil2-ext-atlas";
function FooterWithCustomPlaceholder() {
const [message, setMessage] = useState("");
return (
<Footer
message={message}
onMessageChange={setMessage}
onSubmit={handleSubmit}
placeholder="Type your question here..."
/>
);
}