Frame

A consent-gated content wrapper - children only mount when the required consent category is granted.

Frame conditionally renders its children based on consent state. When consent for the specified category is not granted, a placeholder is shown instead. Children are not mounted at all until consent is given, preventing any network requests or script execution.

Basic Usage

Custom Placeholder

Replace the default placeholder:

Compound Components

Build fully custom placeholder layouts:

  • Frame.Root - Container with default placeholder styling
  • Frame.Title - Displays a consent-request message with the category name
  • Frame.Button - Button that opens the consent dialog for the specified category

Automatic Category Registration

When Frame mounts, it automatically adds its category to the active consentCategories list. This means you don't need to explicitly list the category in your provider's consentCategories option - if a Frame component uses it, it will be registered.

Props

Loading…