Component Slots
What are Slots?
Slots let you target specific parts of consent components with styles. Each component is built from named slots such as consentBannerTitle and consentDialogTag.
Use slots after the stock component APIs and design tokens:
- If the change is semantic, prefer tokens first. For example, the stock banner footer background comes from
theme.colors.surfaceHover. - If the component part is correct but you need a local tweak, use a slot.
Common banner slot choices:
consentBannerCardfor card radius, shadow, width, and local background treatmentconsentBannerFooterfor spacing, borders, and local footer stylingconsentBannerTitlefor title typographybuttonPrimaryandbuttonSecondaryfor shared button classes
Using Slots
Pass slot styles in the theme's slots object:
Slot Style Types
Each slot accepts either a string (treated as className) or a SlotStyle object:
noStyle on a slot is an advanced escape hatch. Start with className and style overrides first.
Example: Style the stock banner without changing markup
Available Slots
Use the typed API reference below for the full slot list and descriptions. It stays in sync with the actual component slot surface.