Skip to main content

<PrivacyShield />

PrivacyShield is a component that conditionally renders children based on the consent decision for a specific integration. It's typically used to wrap content that should only be displayed if the user has consented to the associated integration.

Props

PropTypeDescription
idstringThe identifier for the integration to check consent for.
childrenReact.ReactNodeThe content to render if consent is given.
...propsunknownAdditional props passed to the fallback component.

Prefer a Custom Placeholder or Fallback Component?

Set it up globally using the fallbackComponent property in the ConsentManager component.

Example Usage

import { PrivacyShield } from '@consent-manager/core'

const YouTubeEmbed = ({ videoId }) => (
<PrivacyShield id="youtube">
{/* Your YouTube embed component */}
</PrivacyShield>
)

Example Rendering

Here's an example of what a shield will appear as:

Recommended external content

This feature contains content by Creative CommonsDemo Integration

To view this third-party content, you first have to accept their specific terms and conditions.

This includes their cookie policies, which we have no control over.