ConsentDialog
A modal dialog where users can toggle individual consent categories.
ConsentDialog is a modal that shows toggles for each consent category. In opt-in jurisdictions, it typically opens when users click "Customize" on ConsentBanner. It can also be controlled programmatically for use on settings pages regardless of jurisdiction.
Basic Usage
Controlled State
By default, the dialog follows activeUI === 'dialog' from the consent store. Use the open prop for manual control:
Or use the hook to open it programmatically:
Floating Trigger
Add a floating button that lets users re-open the dialog after dismissing the banner:
Branding
Hide the c15t branding in the dialog footer:
Compound Components
Build fully custom dialog layouts using sub-components:
ConsentDialog.Root— Portal container with focus trap, scroll lock, and animationConsentDialog.Card— Main dialog cardConsentDialog.Header— Contains title and descriptionConsentDialog.HeaderTitle— Dialog titleConsentDialog.HeaderDescription— Description with optionallegalLinksConsentDialog.Content— Main content area (typically containsConsentWidget)ConsentDialog.Footer— Footer with optional branding (hideBrandingprop)ConsentDialog.Overlay— Backdrop overlay
For a quick pre-composed layout, use the shorthand card:
Props
Loading…