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:

  • consentBannerCard for card radius, shadow, width, and local background treatment
  • consentBannerFooter for spacing, borders, and local footer styling
  • consentBannerTitle for title typography
  • buttonPrimary and buttonSecondary for 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.

API Reference

Loading…
Loading…