Theming
Restyle the embed from the outside with --bf-* custom properties for colour, shape and type, ::part() selectors and named slots on the shell, copy keys for every string, and the colour scheme and font options.
Colour, shape and type are tokens, a region of the shell you want to own outright is a slot, and
every string has a copy key. Host-page CSS beats everything the widget resolves at runtime, and
no rule in the widget uses !important. Every table below is rendered from the descriptor the
widget reads.
Theme tokens
Set a token in CSS on the element, or anywhere above it, or with the theme option as JSON.
accent, radius and font are shorthands for the tokens of the same name.
betterfeedback-widget {
--bf-accent: #1d4ed8;
--bf-radius: 12px;
}<script async src="https://ask.betterfeedback.ai/widget.js"
data-survey="YOUR_SURVEY_ID"
data-theme='{"bubble-user-bg":"#eef","bubble-user-fg":"#123"}'></script>Tokens marked "Shell" style the launcher, panel and header on your page. The rest reach the conversation inside the frame, which is the only way to style it: your stylesheet does not cross the frame boundary.
| Custom property | Controls |
|---|---|
--bf-surface | Page background behind the conversation. Transparent by default when embedded inline. |
--bf-text | Primary text: headings, the welcome message. |
--bf-text-muted | Secondary text: hints, timestamps, the footer. |
--bf-border | Hairlines: the input bar, the footer rule. |
--bf-accent | Primary buttons (Start, Send, Talk) and the launcher. |
--bf-accent-hover | Hover state of accent surfaces. Defaults to a darker accent. |
--bf-accent-contrast | Text and icons on accent surfaces. |
--bf-link | Links inside messages. |
--bf-bubble-agent-bg | Background of the agent's messages. |
--bf-bubble-agent-fg | Text of the agent's messages. |
--bf-bubble-user-bg | Background of the visitor's messages. |
--bf-bubble-user-fg | Text of the visitor's messages. |
--bf-visualizer | Base colour of the voice visualiser bars. |
--bf-radius | Corner radius of bubbles and the panel. |
--bf-control-radius | Corner radius of buttons, the input bar and the launcher. |
--bf-font | Font family of everything. |
--bf-focus-ring | Keyboard focus outline colour. |
--bf-header-bg | Shell: panel header background. |
--bf-header-text | Shell: panel header text. |
--bf-launcher-bg | Shell: launcher background. Defaults to accent. |
--bf-launcher-fg | Shell: launcher icon and label. |
--bf-launcher-size | Shell: launcher diameter. |
--bf-launcher-offset-x | Shell: launcher distance from the side edge. |
--bf-launcher-offset-y | Shell: launcher distance from the bottom edge. |
--bf-panel-width | Shell: floating panel width. |
--bf-panel-height | Shell: panel height (floating, and inline without auto height). |
--bf-shadow | Shell: floating panel shadow. |
--bf-z | Shell: z-index of launcher and panel. |
Colour scheme
color-scheme is light, dark or auto. Dark and auto swap the palette defaults inside the
frame and on the shell; your tokens apply on top of whichever palette is active.
Fonts
font is a CSS font-family stack. When the face is not installed on the visitor's machine, pair
it with font-url, an https stylesheet that declares it, such as a Google Fonts link. The font
files behind that stylesheet must allow cross-origin loading, because the conversation loads them
from ask.betterfeedback.ai.
Parts
Shape and layout of the shell, through ::part(). Rules your page writes against a part beat the
widget's own, because declarations from the outer page win over shadow-tree rules.
::part(launcher-container)::part(launcher)::part(launcher-icon)::part(launcher-label)::part(panel)::part(header)::part(header-title)::part(close-button)::part(frame)::part(footer)
betterfeedback-widget::part(frame) { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); }
betterfeedback-widget::part(launcher) { font-weight: 700; }Slots
A slotted element replaces the default content of that region.
slot="launcher"slot="header"slot="footer"
<betterfeedback-widget survey="YOUR_SURVEY_ID">
<button slot="launcher">Talk to us</button>
<p slot="footer">We reply within one business day.</p>
</betterfeedback-widget>Copy
Override any string with the copy option: data-copy='{"startButton":"Let us talk"}', or
betterfeedback("config", { copy: { startButton: "Begin" } }).
| Key | Where it shows |
|---|---|
title | Shell header title. Defaults to the survey's agent name. |
startButton | Label of the Start button on the welcome screen. |
connecting | Text shown while the room connects. |
pressEnter | Hint next to the Start button on desktop. |
talk | Label of the button that switches to voice. |
send | Tooltip of the Send button. |
placeholder | Placeholder of the message input. |
poweredBy | Footer text before the logo, when branding is shown. |
showPrevious | Voice mode: link that reveals earlier messages. |
hidePrevious | Voice mode: link that hides earlier messages. |
exitVoice | Voice mode: label of the control that returns to text. |
answersSent | Ending screen of a survey that redirects: line confirming the answers were sent. |
redirectNotice | Ending screen of a survey that redirects: the countdown line. {site} and {seconds} are filled in. |
continueNow | Ending screen of a survey that redirects: button that follows the redirect at once. |
Avatar
avatar-url replaces the agent's avatar with an https image. The word none hides it; an empty
value keeps the default.
What CSS cannot reach
Host stylesheets do not reach inside the frame: the conversation is themed only through the
tokens, the copy keys and font-url above. The "Powered by" footer is decided by the plan, not by
an option; the poweredBy copy key changes its text when it shows.
Design tab
Set a survey's look once in the dashboard, with a live preview, so the direct link and every embed share the same accent color, color scheme, corner radius, font, avatar, wording and voice setting.
Behaviour
What the floating and inline modes do, how auto height sizes the frame, the launcher and trigger options, open on load, voice off, keyboard handling and what happens when a conversation completes.