Skip to content

CSS theming

The widget exposes a stable CSS API. Both custom properties and named parts are part of the public contract.

For worked examples and use cases, see the Theming guide.

CSS custom properties

PropertyDefault
--chatbot-primary#6366f1
--chatbot-on-primary#ffffff
--chatbot-surface#ffffff
--chatbot-on-surface#1f2937
--chatbot-radius12px
--chatbot-fontsystem-ui, sans-serif
--chatbot-shadow0 8px 32px rgba(0,0,0,0.16)
--chatbot-z-index9999

Set on chatbot-widget, :root, or any ancestor — they inherit through the shadow DOM.

CSS parts

PartElement
launcherFloating launcher button.
panelThe chat panel container.
headerPanel title bar.
messagesScrollable message list.
message-userA user message bubble.
message-assistantAn assistant message bubble.
inputThe text input field.
send-buttonThe send button.
tool-statusTransient status chip shown during a tool call.
extractor-chipTransparency chip listing extractors that ran on the current turn.

Target with ::part(name):

css
chatbot-widget::part(launcher) {
  width: 64px;
  height: 64px;
}

Selector matrix

GoalSelector
Theme one channelchatbot-widget[channel="admin"] { --chatbot-primary: ...; }
Theme inline-mounted widgetschatbot-widget[position="inline"]::part(panel) { ... }
Dark modehtml.dark chatbot-widget { --chatbot-surface: ...; ... }
Always-visible panelchatbot-widget::part(panel) { display: block; }

What is NOT in the API

  • Internal element class names. Inspecting the shadow DOM and targeting .chatbot__panel (or similar) will break in any release.
  • Animation/transition timings. Customise via transition overrides on a ::part(...) selector instead.
  • Z-index of the launcher relative to the panel. Use --chatbot-z-index to relocate the whole stack.

Released under the MIT License.