ConsentWidget
ConsentWidget is a standalone, inline consent management widget. Unlike ConsentDialog (which is a modal), the widget embeds directly in your page layout - ideal for privacy settings pages, account preferences, or any page where users should be able to manage consent without a modal overlay.
Basic Usage
Configuration
Accordion Behavior
Each consent category is rendered as an expandable accordion item. Clicking the category header expands it to show a description and any associated services. Users can toggle individual categories on or off using the switch control. The necessary category is always enabled and cannot be toggled.
Styling First
Info
Most widget customization should stay in the stock component. Use theme tokens and slots such as consentWidgetAccordion, consentWidgetFooter, and toggle before reaching for compound components. See Styling Overview.
Widget copy should be changed through ConsentManagerProvider.options.i18n so the inline UI stays aligned with the rest of the consent experience.
Advanced: Compound Components
Use compound components only when you need to rearrange the widget's existing primitives while keeping policy-aware action grouping:
ConsentWidget.Root— Theme context providerConsentWidget.Accordion— Radix-based accordion rootConsentWidget.AccordionItems— Auto-generates toggle items from consent configConsentWidget.AccordionItem— Individual category itemConsentWidget.AccordionTrigger— Clickable header for each itemConsentWidget.AccordionContent— Collapsible content areaConsentWidget.AccordionArrow— Expand/collapse indicatorConsentWidget.Switch— Category toggle switchConsentWidget.PolicyActions— Renders grouped policy-aware actionsConsentWidget.Footer— Footer containerConsentWidget.FooterSubGroup— Groups related buttonsConsentWidget.AcceptAllButton— Accepts all consentConsentWidget.RejectButton— Rejects all consentConsentWidget.SaveButton— Saves custom selections
Using renderAction with c15t Defaults
ConsentWidget.PolicyActions renders stock c15t buttons and translations by default.
renderAction is optional. Return the stock button compounds when you want custom mapping while preserving built-in c15t behavior and copy:
renderAction is still meant for stock button compounds. If you want completely custom button elements and handlers, use useHeadlessConsentUI() and render dialog.actionGroups manually instead of ConsentWidget.PolicyActions.
For a fixed footer layout, render ConsentWidget.Footer and ConsentWidget.FooterSubGroup manually instead of using ConsentWidget.PolicyActions.
If the stock widget structure is already correct, stay with tokens and slots instead of rebuilding the layout.