Where styling lives as of SDK v3.2+. Colors, borders, alignment, and width are driven by CSS custom properties — not by HTML attributes. These variables can be set two ways:Legacy HTML attributes like
- From the Settings API (preferred) — theming is configured per-tenant in the Bonsai dashboard and injected into the component’s shadow DOM automatically at load time.
- From your page’s CSS — set any variable on the
<bonsai-searchbar>element itself to customize per-embed. Page CSS wins over the Settings API because Settings-API variables are injected at:hostlow specificity.
Two restrictions. Set variables on the element, never on
:root or a wrapper — the SDK declares its defaults on :host, and an inherited value loses to a direct one. And under theme="dark" the colour variables are fixed by the theme and cannot be overridden at all; see Dark theme below.brand-color, text-color, input-bg, card-bg, results-columns, input-opacity, etc. are no longer supported — use the variables below instead.CSS Variables
Set any of these on the<bonsai-searchbar> element itself to override the defaults or Settings-API values.
Reference Table
Dark theme
theme="dark" declares its palette on an element inside the search bar’s shadow root, so page CSS, inline style="", !important and Settings-API colours are all outranked. The colour variables cannot be changed while it is set.theme="light" and supply the palette yourself. The block below is the built-in dark palette, copied out so you can edit it — the bar looks the same as theme="dark", except these lines now work.
rgba(0, 0, 0, 0.06) border on a dark page, for example. The full explanation, and the complete list of variables the theme takes over, is in Dark theme; the mechanism is identical for both components.
Search Bar Parts
The search bar exposes the same part names as
<bonsai-search>. There are no searchbar--prefixed parts. <bonsai-searchbar> is built on the same internal control and emits the same part attributes; only the input, suggestions and footer subset is present, since a search bar renders no results.
The complete part list, including everything only
<bonsai-search> renders, is in the Bonsai Search parts reference.