Skip to main content

Theme

Customize the chatbot appearance through the theme prop. Every color, spacing, and radius value in the default theme can be overridden.

Presets

Current Theme Config

{}
Loading chatbot...
tip

Try the Crazy preset to see every theming slot in action at once.

Code Example

import { Chatbot } from "@asgard-js/react";
import type { AsgardThemeContextValue } from "@asgard-js/react";

const myTheme: Partial<AsgardThemeContextValue> = {
chatbot: {
backgroundColor: "#3c1d3b",
borderColor: "#92ff8c",
primaryComponent: {
mainColor: "#ff0000",
secondaryColor: "#aba400",
},
},
botMessage: {
color: "#00f0ff",
backgroundColor: "#ff7a00",
},
userMessage: {
color: "#522801",
backgroundColor: "#060081",
},
};

<Chatbot theme={myTheme} {...rest} />;

Theme Structure

LevelFieldsDescription
chatbotbackgroundColor, borderColor, borderRadiusOuter frame styles
chatbotcontentMaxWidth, width, heightSize controls
chatbotmainColor, secondaryColor, inactiveColorGlobal colors
chatbot.primaryComponentmainColor, secondaryColorPrimary interactive element colors
chatbot.headerstyle, title.style, actionButton.styleHeader styles
chatbot.bodystyleMessage area styles
chatbot.footerstyle, textArea.style, submitButton.style, speechInputButton.styleInput area styles
botMessagecolor, backgroundColor, linkColor, quickReplyBackgroundColorBot message bubble
userMessagecolor, backgroundColorUser message bubble
templatequickReplies.style, references.style, time.styleTemplate element styles
Colors propagate across the whole chat surface (0.3.x)

These three chatbot colors are wired to the SDK's --asg-color-* design tokens, so setting them recolors the newer surfaces too (the running indicator, composer input, channel-title bar, tool-call groups, thinking block, and Task / Subagent panels):

  • chatbot.primaryComponent.mainColor--asg-color-primary (+ a derived darker hover)
  • chatbot.backgroundColor--asg-color-bg / --asg-color-surface
  • chatbot.borderColor--asg-color-border / --asg-color-divider

Tokens are injected only when a concrete color is provided (a #rrggbb hex, or a non-var() border); otherwise the built-in defaults are kept.