Widget Customization
Customize the appearance and behavior of your chat widget.
Customize the Grounded widget to match your brand and user experience requirements.
Dashboard Settings
Most customization options are available in your chatbot settings:
- Go to your Dashboard
- Select your chatbot
- Click Settings
Appearance Options
| Setting | Description |
|---|---|
| Widget Name | Displayed in the chat header |
| Welcome Message | First message shown to visitors |
| Primary Color | Button and accent color |
| Position | Bottom-right or bottom-left |
| Avatar | Upload a custom avatar image |
Data Attributes
Override settings with HTML data attributes:
<script
src="https://grounded.sh/widget/grounded-widget.js"
data-chatbot-id="YOUR_CHATBOT_ID"
data-position="bottom-left"
data-primary-color="#4f46e5"
data-welcome-message="Hi! How can I help you today?"
async
></script>
Available Attributes
| Attribute | Values | Description |
|---|---|---|
data-position | bottom-right, bottom-left | Widget position |
data-primary-color | Hex color (e.g., #4f46e5) | Primary color |
data-welcome-message | String | Override welcome message |
CSS Customization
For advanced styling, target the widget's CSS classes:
/* Custom widget button */
#grounded-widget-button {
/* Your styles */
}
/* Chat container */
#grounded-widget-container {
/* Your styles */
}
/* Message bubbles */
.grounded-message-bot {
/* Bot message styles */
}
.grounded-message-user {
/* User message styles */
}
CSS class names may change between versions. Use these sparingly and test after updates.
Programmatic Control
Control the widget with JavaScript:
// Open the widget
window.GroundedWidget.open();
// Close the widget
window.GroundedWidget.close();
// Toggle the widget
window.GroundedWidget.toggle();
// Check if widget is open
const isOpen = window.GroundedWidget.isOpen();
Custom Trigger Buttons
Create your own chat button:
<button onclick="window.GroundedWidget.open()">
Chat with us
</button>
To hide the default button, add CSS:
#grounded-widget-button {
display: none;
}
Domain Restrictions
Restrict where your widget can be embedded:
- Go to Settings > Security
- Add allowed domains under Allowed Domains
- Only listed domains can use your widget
Leave the allowed domains empty to allow embedding on any domain (useful for development).
Mobile Optimization
The widget is mobile-responsive by default. For best results:
- Test on actual mobile devices
- Ensure your site doesn't have
overflow: hiddenon body - The widget adapts to screen size automatically