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 animation
  • ConsentDialog.Card — Main dialog card
  • ConsentDialog.Header — Contains title and description
  • ConsentDialog.HeaderTitle — Dialog title
  • ConsentDialog.HeaderDescription — Description with optional legalLinks
  • ConsentDialog.Content — Main content area (typically contains ConsentWidget)
  • ConsentDialog.Footer — Footer with optional branding (hideBranding prop)
  • ConsentDialog.Overlay — Backdrop overlay

For a quick pre-composed layout, use the shorthand card:

Props

Loading…