Skip to Content
BetterFeedback Docs

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 propertyControls
--bf-surfacePage background behind the conversation. Transparent by default when embedded inline.
--bf-textPrimary text: headings, the welcome message.
--bf-text-mutedSecondary text: hints, timestamps, the footer.
--bf-borderHairlines: the input bar, the footer rule.
--bf-accentPrimary buttons (Start, Send, Talk) and the launcher.
--bf-accent-hoverHover state of accent surfaces. Defaults to a darker accent.
--bf-accent-contrastText and icons on accent surfaces.
--bf-linkLinks inside messages.
--bf-bubble-agent-bgBackground of the agent's messages.
--bf-bubble-agent-fgText of the agent's messages.
--bf-bubble-user-bgBackground of the visitor's messages.
--bf-bubble-user-fgText of the visitor's messages.
--bf-visualizerBase colour of the voice visualiser bars.
--bf-radiusCorner radius of bubbles and the panel.
--bf-control-radiusCorner radius of buttons, the input bar and the launcher.
--bf-fontFont family of everything.
--bf-focus-ringKeyboard focus outline colour.
--bf-header-bgShell: panel header background.
--bf-header-textShell: panel header text.
--bf-launcher-bgShell: launcher background. Defaults to accent.
--bf-launcher-fgShell: launcher icon and label.
--bf-launcher-sizeShell: launcher diameter.
--bf-launcher-offset-xShell: launcher distance from the side edge.
--bf-launcher-offset-yShell: launcher distance from the bottom edge.
--bf-panel-widthShell: floating panel width.
--bf-panel-heightShell: panel height (floating, and inline without auto height).
--bf-shadowShell: floating panel shadow.
--bf-zShell: 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" } }).

KeyWhere it shows
titleShell header title. Defaults to the survey's agent name.
startButtonLabel of the Start button on the welcome screen.
connectingText shown while the room connects.
pressEnterHint next to the Start button on desktop.
talkLabel of the button that switches to voice.
sendTooltip of the Send button.
placeholderPlaceholder of the message input.
poweredByFooter text before the logo, when branding is shown.
showPreviousVoice mode: link that reveals earlier messages.
hidePreviousVoice mode: link that hides earlier messages.
exitVoiceVoice mode: label of the control that returns to text.
answersSentEnding screen of a survey that redirects: line confirming the answers were sent.
redirectNoticeEnding screen of a survey that redirects: the countdown line. {site} and {seconds} are filled in.
continueNowEnding 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.

On this page