Appearance and themes
Style the banner with design tokens, 21 built-in theme presets, and custom CSS.
Last updated:
The banner's look is controlled entirely by design tokens: a fixed set of CSS custom properties covering colors, typography, spacing, and shape. Themes are named bundles of those tokens, and everything renders from them: there are no hard-coded styles to fight.
Theme presets
CookieBeam ships 21 built-in presets; light and dark defaults, high-contrast, minimal, and branded-color variants (Forest Green, Ocean Blue, Midnight Indigo, Glassmorphism, and others). Each preset defines a complete token set: background and text colors, primary and secondary button colors with hover states, toggle colors (including the read-only state), category block and separator colors, font family and size, modal and button corner radii, and the banner's width and screen offset.
Pick a preset in the banner designer as your starting point, then adjust individual tokens. Applying a preset replaces your token set with the theme's values; that token replacement is what changes the banner's appearance. The preset's colorScheme value (light or dark) is saved as designer metadata and drives the designer's own scheme indicator; the shipped widget does not read it to switch rendering modes, so a "dark" scheme with light tokens renders light.
You do all of this in Dashboard → Banners → your banner → Design, in the Styling section. Click Save in the designer header, then Publish from the banner header to ship the change.
Editing tokens
Every visual property is a token you can override without touching CSS:
- Colors: background, primary/secondary text, button backgrounds and labels with hover states, toggle on/off/read-only colors, block and border colors.
- Typography: font family and base size.
- Shape and layout: modal and button border radii, banner width, and edge offsets.
Token names are checked only for well-formedness (they must look like --some-name). A misspelled but syntactically valid name (--cc-primary-colour instead of the real token) passes validation and publishes fine; the widget simply never reads it, and your override has no effect. If a token change doesn't show up in the preview, check the exact name first.
Consent modal layout
The consent modal (the first thing visitors see) supports several layout variants:
| Layout | Description |
|---|---|
box | A floating card, usually in a corner |
box wide | A wider floating card |
box inline | A card that sits inline in the page flow |
cloud | A rounded, compact card |
cloud inline | The cloud variant sitting inline |
bar | A full-width strip across the top or bottom |
bar inline | A full-width strip that pushes page content |
Pick the layout in the designer's Layout section. The bar layouts work well for sites that want maximum visibility; box and cloud are less intrusive.
Modal position
Both the consent modal and preferences modal have a position setting. The consent modal supports 9 positions:
top left, top center, top right, middle left, middle center, middle right, bottom left, bottom center, bottom right
The preferences modal adds left, right, center, top, and bottom as options and supports four layout types: box, side, side wide, and bar.
Button configuration
Three settings control button presentation:
equalWeightButtons- gives primary and secondary buttons the same visual weight. Whenfalse, the accept button is visually prominent and reject is subdued.flipButtons- reverses the button order. By default, accept comes first; flipping puts reject first.showAcceptNecessary- whether the "Accept necessary" (reject all) button appears. Default istrue.
These apply independently to the consent modal and preferences modal, so you can have different button layouts in each.
Preferences trigger
The preferencesTrigger setting controls where the "Show preferences" link appears in the consent modal:
button(default) - shows as a button in the button row.footerLink- shows as a text link in the footer area.
Control style
In the preferences modal, consent choices render as either toggles (the default) or checkboxes. The controlStyle setting on preferencesModal picks between them:
toggle- slide toggles, common in mobile-style UIs.checkbox- standard HTML checkboxes.
This also affects the TCF vendor list and US opt-out purpose panels.
Close button
Dashboard-created banners have the close button on by default. Self-hosted configs default to off. When enabled, an X button appears on both the consent modal and preferences modal, and the Escape key dismisses them.
Consider carefully before enabling this: a visitor who closes without choosing leaves the consent state unchanged. In opt-in mode that means no non-necessary categories are granted. In opt-out mode it means the pre-activated categories stay active, but the visitor hasn't made an affirmative choice.
Page interaction blocking
When disablePageInteractionOnShow is true, the page behind the banner is dimmed and non-interactive while the consent modal is visible. This forces the visitor to make a choice before interacting with the page.
This is configured in the RuntimeConfig, not in GuiOptions. It's useful for strict opt-in implementations where legal requirements demand an affirmative choice before any tracking, but it degrades the visitor experience and should be used only when required.
Floating settings button
After a visitor makes their choice and the banner closes, a floating settings button gives them a way back to the preferences panel. It's a small circular button fixed to a corner of the viewport.
| Setting | Type | Default | What it controls |
|---|---|---|---|
position | string | 'bottom-right' | Corner of the viewport: top-left, top-right, bottom-left, bottom-right |
icon | string | 'gear' | Button icon: 'gear', 'cookie', or a custom string |
showAfterConsent | boolean | false | Whether the button appears after the visitor has made a choice |
size | number | 40 | Button diameter in pixels (range: 32-96) |
offset | number | 20 | Distance from viewport edge in pixels (range: 0-100) |
backgroundColor | string | theme primary | CSS color value or variable |
color | string | theme primary text | Icon/text color |
hoverBackgroundColor | string | theme primary hover | Background on hover |
accessibleLabel | string | - | Screen reader label for the button |
The button is also the primary re-entry point when a privacy signal hides the banner in hard_optout mode.
Dark mode
The darkMode setting on GuiOptions controls the banner's color scheme:
light(default) - always uses the light theme tokens.dark- always uses the dark theme tokens.auto- follows the visitor's OS preference viaprefers-color-scheme.
In auto mode, the banner switches between light and dark tokens based on the visitor's system setting. Both the light and dark token sets must be defined in the theme for this to work.
Logo
Add your logo to the consent modal and preferences modal header with the logo configuration:
| Setting | Type | Options |
|---|---|---|
url | string | HTTPS URL of the logo image |
position | string | start, center, title-end, footer |
size | string | sm, md, lg |
alt | string | Alt text (falls back to the page hostname) |
The footer position places the logo at the start of the consent banner footer row, which keeps it visible without competing with the consent description text.
Upload your logo in the banner designer under Styling. Published banners serve the logo from the CookieBeam CDN.
Language switcher
A visitor-facing language menu in the banner footer. See Languages for setup details.
Animation
The consent modal supports entrance animations:
| Animation | Effect |
|---|---|
fade | Fades in from transparent |
slide-up | Slides up from below the viewport |
slide-down | Slides down from above |
scale | Scales up from a smaller size |
none | Appears instantly |
The animation configuration also includes:
duration- animation length in milliseconds.respectPrefersReducedMotion- whentrue(default), visitors withprefers-reduced-motion: reduceget no animation regardless of the setting.
Custom CSS
When tokens aren't enough, add your own CSS in the designer. It's layered over the token output, so presets and tokens keep working underneath. Custom CSS is a plan-gated feature; check your plan's feature list.
Custom CSS you add in the designer is injected as a <style> element in the document's <head>. It targets the banner's elements in the document scope, alongside your page's own styles. The banner uses scoped class names and specificity to avoid conflicts with your page CSS. Use the browser inspector to find the class names you need.
Where styling applies
The same tokens style the consent banner, the preferences modal, and the floating settings button, so one theme keeps the whole consent surface consistent. The server-side publish step compiles your tokens into the banner bundle; visitors never download presets they aren't using.
Per-region layout overrides (bar vs. box, position, button order) are configured on regional rules, not in the theme; see Regional rules.
A banner can have more than one theme. To compare themes on real traffic, use A/B testing.
Responsive behavior
The banner adapts to the viewport width automatically:
- Bar layouts span the full viewport width on all screen sizes. Text wraps, and buttons stack vertically when they don't fit side by side.
- Box and cloud layouts have a max width set by the banner-width token. On narrow viewports, the modal shrinks to fit and buttons stack.
- Side layouts for the preferences modal take up a fixed portion of the screen on wide viewports and go full-width on mobile.
The floating settings button remains fixed in its configured corner at all viewport sizes. Its offset setting (distance from the edge) applies on mobile too; if you set a large offset, check that it doesn't overlap with mobile browser chrome.
You don't need media queries in custom CSS for basic responsiveness. If you do add custom CSS with media queries, test on actual mobile devices; the preview in the designer is an approximation.
Accessibility
The banner follows WAI-ARIA patterns for dialog accessibility:
- The consent modal is announced as a dialog with an accessible name from its heading.
- Focus is trapped inside the modal while it's open.
- The floating settings button has an
accessibleLabelread by screen readers. - Toggle controls in the preferences modal are
role="switch"witharia-checkedstate. - The High Contrast preset is designed for elevated contrast ratios. Check your chosen preset's contrast with the Chrome DevTools contrast checker or a similar tool.
If you add custom CSS that changes colors, verify contrast ratios with a tool like the Chrome DevTools contrast checker. If you change focus styles, make sure focus remains visible for keyboard users.
Verify appearance changes
- Save and Publish in the designer. Token and layout changes only ship on publish.
- Open your site in a private window. Check that the banner renders with the expected layout, position, colors, and fonts.
- Open the preferences modal and verify tokens apply there too.
- If using
darkMode: 'auto', toggle your OS dark mode setting and confirm the banner switches. - After making a choice, confirm the floating settings button appears (if configured) and re-opens the preferences panel.
- Test on mobile viewports: the banner should adapt to narrow screens without horizontal overflow.
Related pages
- Regional rules; per-region layout overrides
- A/B testing; compare themes on live traffic
- Languages; translation and language switcher setup
- Content Security Policy: CSP entries the banner needs for inline styles