Consent

A consent banner and preference panel driven by the site’s categories, policy version and service configuration.

Consent

View source · API reference

Make and revise a choice

Accept, reject or choose optional categories, then reopen settings. Reset clears only the isolated example’s saved choice. No tracking services are configured.

Behavior and accessibility

Consent renders only when site.consent.enabled is true. The runtime opens the banner when no current saved choice exists, persists choices under storageKey and uses policyVersion to identify the policy. Necessary categories remain selected. Keep labels and descriptions specific to the services your site actually runs.

API reference

Consent contract

The three public props style the component. Banner copy, categories, storage, policy version and services come from site.consent, not markup props.

Composition

No public slots. The settings button teleports to .consent-settings-teleport-area, provided by SiteFooter or by your own template. Register defineConsentComponents with Panel, Flex, Btn, BtnLink and FormCheck. Include the standard consent runtime with the same resolved configuration.

Configuration responsibilities

  • enabled controls whether the component exists.
  • storageKey isolates saved choices; policyVersion identifies the current policy.
  • categories define IDs, visible labels, descriptions and required state.
  • services describe the services controlled by those categories.
  • Banner, button and policy-link copy belong in the consent configuration.

The preview source shows the complete scoped override used by the working example.