PrivacyKit Web Components

Public web component documentation for consent-dialog, consent-guard, consent-missing, and consent-validator.

Table of Contents





CSS Snippets

Avoid flickering before the web components finish loading. Without this snippet the slotted or guarded HTML can flash briefly when:

  1. consent-dialog can flash briefly if slotted elements are used and if they render before the component definition loads.
  2. consent-guard can flash briefly if it's used for conditional HTML and it renders before the component activates.
  3. consent-missing can flash briefly if consent-missing is used and it renders before the component activates.

Add styling in your light DOM to avoid flickering.

NPM
CSS
consent-dialog:not(:defined) [slot] {
  display: none;
}

consent-guard:not([active]) {
  display: none;
}

consent-missing:not([active]) {
  display: none;
}