Skip to main content
Introducing packages.sweber.dev
Documentation menuComponents

Components

Props of all React components.

PermitoProvider

PropDescription
configConsentConfig. Read once on mount; change the key to apply a new config.
managerUse an existing core manager instead.
translationsText overrides, see Translations.
privacyPolicyUrl, imprintUrlLinks shown in the banner and preference center.
googleConsentModetrue or { mapping, dataLayerName }.
blockedElementstrue or { root, allowlist, nonce }. Activates blocked markup.
theme"light" or "dark". Default: follow the page.
portalContainerElement that overlays are portaled into. Default document.body.

ConsentBanner

PropDefaultDescription
position"bottom"bottom, top, bottom-left, bottom-right, center
autoFocustrueMove focus to the banner when it appears.
hideCustomizefalseHide the settings button. Only do this if the preference center is reachable elsewhere.
privacyPolicyUrlprovider value
className, unstyled
childrenExtra content above the buttons.
portaltruetrue, an element, or false to render in place.

The banner renders only on the client and only while no valid decision exists.

PreferenceCenter

Modal dialog (aria-modal), focus trapped, closes with Escape, restores focus. Props: className, unstyled, serviceToggles (default true), portal.

PreferencesButton

Floating button to reopen the preference center after a decision. Props: position (bottom-left, bottom-right), className, unstyled, portal. You can also call openPreferences() from a footer link.

ConsentGate

category or service, children, fallback.

ConsentScript

category or service, src, plus id, async, defer, nonce, attributes, allowlist, onLoad, onError.

ConsentIframe

category or service, src, title (required), placeholder, placeholderClassName, unstyled, and any iframe attribute.