Customize the widget from Kommander.ai settings first. Runtime CSS overrides should be used only for host-page layout constraints or carefully scoped brand refinements.
Settings-Driven Customization
| Option | Where to configure | Effect |
|---|---|---|
| Assistant name | Settings > Customization | Header name and welcome message. |
| Brand color | Settings > Customization | Launcher, header, user messages, and primary actions. |
| Widget image | Settings > Customization | Replaces the default launcher icon with your uploaded image. |
| Language | Settings > Customization | Default widget UI language. |
| Automatic language detection | Settings > Customization | Uses the visitor browser language and first message language when enabled. |
| Preset messages | Settings > Presets | Shows up to 5 quick-start buttons above the input. |
| Branding visibility | Settings > Customization | Controls the Kommander.ai footer mark when plan settings allow it. |
The hosted widget refreshes settings when it loads. If you change settings in Kommander.ai, reload the host page to verify the new appearance.
Runtime Options
window.initKommanderChatbot({
userId: "YOUR_KOMMANDER_USER_ID",
containerId: "kommander-chatbot",
timerEnabled: false,
userData: {
plan: "pro",
locale: "en"
}
});userData is for analytics and non-secret routing attributes. Do not use it for trusted authorization; use Identity Verification for that.
CSS Variables
The widget stylesheet exposes these variables on :root and updates the primary colors from Kommander.ai settings:
:root {
--kommander-primary-color: #1a1a1a;
--kommander-secondary-color: #2a2a2a;
--kommander-header-text-color: #fff;
--kommander-bg-light: #fff;
--kommander-border-color: #d1d5db;
--kommander-input-bg: #fff;
--kommander-input-text: #000;
--kommander-user-message-bg: var(--kommander-primary-color);
--kommander-assistant-message-bg: var(--kommander-bg-light);
}Prefer setting the brand color in Kommander.ai. If you override variables in host CSS, place the override after the widget script has loaded its stylesheet.
Scoped CSS Overrides
Use widget class names only when a host page has a real layout conflict. Keep overrides narrow and test mobile and desktop.
.kommander-button-wrapper {
bottom: calc(20px + env(safe-area-inset-bottom));
right: 20px;
}
@media (min-width: 640px) {
.kommander-window {
max-height: calc(100dvh - 120px);
}
}Common classes include:
| Class | Purpose |
|---|---|
.kommander-button-wrapper | Fixed launcher position. |
.kommander-button | Launcher button surface. |
.kommander-window | Open chat window. |
.kommander-header | Header bar. |
.kommander-messages | Scrollable message area. |
.kommander-input | Visitor input. |
Styling Guidelines
- Keep the widget above cookie banners, sticky footers, and mobile safe areas.
- Do not hide the close button or input.
- Do not set a
z-indexhigher than the widget unless another overlay must temporarily win. - Avoid global CSS rules targeting
button,input,svg, ordivwithout scoping; they can unintentionally affect the widget. - Test at widths below 640px, where the widget opens as a full-screen mobile surface.