Skip to content

Style overrides

Open in ChatGPT Open in Claude

Restyle individual agent components without rebuilding the theme. Pass a styleOverride object to setConfiguration to control layout, borders, color, and typography on specific components.

Style override anatomy showing entryComponentStyle and speechBubbleStyle targets Assistant entryComponentStyle Welcome! How can I help you today? Show my recent orders Reset my password horizontal Alignment borderWidth borderColor Show my recent orders from last week speechBubbleStyle padding borderRadius backgroundColor color fontSize lineHeight Ask me anything...

For global theming, see Dark Mode.

Header alignment comparison showing left, center, and right horizontalAlignment values Agent "left" Agent "center" Agent "right"

Styles the entry component, including its header layout and the conversation starter borders. This is an object with nested properties for each area of the entry component.

Type: object

Default value:

{
"header": {
"horizontalAlignment": "start"
},
"conversationStarter": {
"borderWidth": 1,
"borderColor": "#000000"
}
}
PropertyTypeDefaultDescription
header.horizontalAlignment"start" | "center" | "end""center"Horizontal alignment of header content.
conversationStarter.borderWidthnumber1Border width of each conversation starter.
conversationStarter.borderColorstring""Border color of each conversation starter.

Styles the user message speech bubble. Use it to control spacing, color, and typography inside the bubble.

Type: object
Default value: {}

PropertyTypeDescription
paddingstringInternal spacing inside the speech bubble.
borderRadiusstringCorner rounding of the speech bubble.
backgroundColorstringBackground color of the speech bubble.
colorstringText color inside the speech bubble.
fontSizestringFont size for bubble text.
lineHeightstringLine height for text inside the bubble.
foldspace.agent('API-KEY').setConfiguration({
styleOverride: {
entryComponentStyle: {
header: {
horizontalAlignment: "start"
},
conversationStarter: {
borderColor: "#E6E9EE",
borderWidth: 1
}
},
speechBubbleStyle: {
padding: "14px 16px",
borderRadius: "12px",
backgroundColor: "#FFFFFF",
color: "#0B1220",
fontSize: "14px",
lineHeight: "1.4"
}
}
});