Consent
ConsentPrivacy preferences Let visitors choose which optional cookies and services your site may use, and change their preferences later.
Site navigation & servicesConsent gives visitors control over optional cookies and services, such as analytics or marketing. Its banner offers Accept all, Reject non-essential, and Manage preferences. The preferences panel lets visitors choose individual categories while required categories stay enabled.
Consent remembers the saved choice and loads configured optional services only after permission is granted. Visitors can reopen preferences using either option above, change their choices, and save again.
Open privacy preferences
With consent enabled in your site configuration, Consent is included automatically. Choose either of these two ways to let visitors reopen their preferences after making a choice.
1. Use your own button or link
Add data-consent-action="open-panel" to a Btn or BtnLink in your footer, navigation, or page content. Clicking it opens the privacy preferences panel.
For a button:
<Btn tone="neutral" variant="outline" data-consent-action="open-panel">
Manage privacy settings
</Btn> For a link:
<BtnLink
href="/legal/privacy/"
tone="neutral"
variant="link"
data-consent-action="open-panel"
>
Privacy settings
</BtnLink> 2. Use the default teleport area
Place this empty element where you want the default Privacy settings button to appear:
<span class="consent-settings-teleport-area"></span> Consent automatically places its settings button inside that element. SiteFooter already provides this area. If the area is absent, Consent does not add a settings button.
Make and revise a choice
This preview uses this site's real consent settings and shares its saved privacy choice. Open settings to review the configured categories.
Banner choices, required and optional categories, saved settings, and services. Open the source tab to adapt the composition.
---
template: preview
index: false
title: consent preview
---
<SectionHeader
title="Privacy settings example"
titleTag="h2"
subtitle="Make a choice, then reopen settings to change it."/>
<Consent settingsTeleport=""/>
<Flex wrap="true" class="mt-3">
<Btn tone="neutral" variant="outline" data-consent-action="open-panel">
Manage privacy settings
</Btn>
<BtnLink
href="/legal/privacy/"
tone="neutral"
variant="link"
data-consent-action="open-panel"
>
Privacy settings
</BtnLink>
</Flex> All ten semantic tones
All supported values are visible together on the actual component, in an isolated document.
Samples follow this guide’s theme. Service appearance comparisons do not register account, search, or consent services.
All eighteen visual variants
All supported values are visible together on the actual component, in an isolated document.
Samples follow this guide’s theme. Service appearance comparisons do not register account, search, or consent services.
Both variant modes
Compare stateless and stateful outlineFill treatments. Hover the samples; a stateful surface does not create new application behavior.
Samples follow this guide’s theme. Service appearance comparisons do not register account, search, or consent services.
Every step of the preference flow
Use the working example to open, save, close, and reopen this site's real privacy settings. It shares the site's categories, services, and storage key.
BannerPrivacy choices Accept all · Reject optional · Manage preferences · Read the privacy policy.
Preference panelNecessary + optional categories Required categories are locked. Optional categories can be changed before saving.
Saved choiceSettings remain available Reopen from the settings control, revise preferences, and save again.
Policy or storage resetA fresh decision A new policyVersion or clearing the example storage brings back the banner.
Required categories remain enabled. A saved choice is checked against policyVersion; changing that version asks for a fresh decision.
Configuration
| Configuration | Visible role |
|---|---|
| enabled | Determines whether the component renders. |
| storageKey, policyVersion | Set where choices are saved and when visitors must make a fresh choice. |
| categories | Give each category an ID, label, description, and required flag. |
| services | Associate each optional service with the category that gives it permission to load. |
| Banner, action, and settings labels | Customize the language of the banner, buttons, and preferences. |
| privacyPolicyUrl, privacyPolicyLabel | Add the policy destination beside the banner copy. |
Keep category labels and descriptions specific to the services your site uses.
API reference
Consent contract
Appearance props style the component; settingsTeleport places its settings button. Banner copy, categories, storage, policy version and services come from site.consent, not markup props.
tone
RefOrValue<SemanticTone> - Default
neutral
Semantic intent: neutral, accent, secondary, info, success, warning, danger, feature, custom or ghost. The active skin supplies the colors.
variant
RefOrValue<ComponentVariant> - Default
surfaceAlt
Visual treatment. Accepts solid, surface, surfaceAlt, spotlight, glass, flat, flatAlt, flatSolid, outlineFill, outline, subtle, subtleBtn, link, sheen, underline, rail, bracket or none.
variantMode
RefOrValue<ComponentVariantMode> - Default
stateless
Use stateless for content surfaces; stateful enables the treatment’s hover, focus and active styles. It does not add interaction handlers.
settingsTeleport
string - Default
.consent-settings-teleport-area
CSS selector for the built-in settings button's destination. Provide the target before Consent renders. An empty selector or a missing target omits the button; the banner and preference panel remain available.
Composition
Consent is included automatically when enabled. Use a Btn or BtnLink with data-consent-action="open-panel" to open preferences, or provide .consent-settings-teleport-area for the default settings button. No public slots.