- Implementation
- Footer API
Common Examples
Copy
Ask AI
import { Footer } from "@servicetitan/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:Copy
Ask AI
import { Footer } from "@servicetitan/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:Copy
Ask AI
import { Footer } from "@servicetitan/ext-atlas";
function FooterWithActions() {
const [message, setMessage] = useState("");
return (
<Footer
message={message}
onMessageChange={setMessage}
onSubmit={handleSubmit}
onUploadFile={() => openFileDialog()}
onDictateMessage={() => startVoiceInput()}
/>
);
}
Custom Placeholder
Copy
Ask AI
import { Footer } from "@servicetitan/ext-atlas";
function FooterWithCustomPlaceholder() {
const [message, setMessage] = useState("");
return (
<Footer
message={message}
onMessageChange={setMessage}
onSubmit={handleSubmit}
placeholder="Type your question here..."
/>
);
}
Copy
Ask AI
<Footer
message={message}
onMessageChange={setMessage}
onSubmit={handleSubmit}
isLoading={false}
placeholder="Ask Atlas"
onUploadFile={handleUpload}
onDictateMessage={handleDictate}
/>
Footer Props
The current value of the message input.
Callback fired when the message input value changes.
Callback fired when the user submits a message.
Additional CSS class name for custom styling.
When true, disables the input and prevents submission.
Callback for the “Dictate message” menu action. Menu item only renders when provided.
Callback for the “Upload file” menu action. Menu item only renders when provided.
Placeholder text displayed in the input when empty.
Test ID Props
Test ID for the privacy policy link.
Test ID for the message input element.
Test ID for the send button.
