Skip to content

Banner Anatomy

The banner has a two-layer split: .ag-banner owns the visual surface (background, shadow, border), while .ag-banner-inner owns the layout (padding, content order).

.ag-overlay (.minimized while folded)
└── .ag-banner [role=dialog, aria-modal, aria-label, aria-describedby] (.expanded, .minimized)
    ├── #ag-minimize .ag-minimize? (when visitors may minimize the banner and have not decided yet)
    └── .ag-banner-inner
        ├── .ag-logo? (optional, when customer logoUrl set)
        ├── .ag-lang-select? (optional, when multiple translations available and the setting shows it)
        ├── .ag-content
        │   ├── (template signature decorations: ::before/::after pseudo-elements)
        │   ├── .ag-title
        │   ├── .ag-desc
        │   └── .ag-gpc-notice? (while Global Privacy Control applies, before the visitor's own choice)
        ├── .ag-btns
        │   ├── #ag-reject-all       .ag-btn .btn-secondary  [data-button="reject"]
        │   ├── #ag-accept-all       .ag-btn .btn-primary   [data-button="accept"]
        │   └── #ag-accept-selected  .ag-btn .btn-save      [data-button="accept"] (hidden until granular mode)
        ├── .ag-bar-cats
        │   ├── .ag-bar-cats-header
        │   │   ├── .ag-bar-cats-label
        │   │   └── #ag-toggle-details (Customize button)
        │   └── .ag-bar-cats-list
        │       └── .ag-bar-cat × N (one chip per category)
        ├── .ag-detail [role=region, aria-hidden=true|false]
        │   └── .ag-detail-grid
        │       └── .ag-detail-cat × {necessary, preferences, statistics, marketing}
        │           ├── .ag-detail-cat-head
        │           │   ├── .ag-detail-cat-name
        │           │   └── .ag-detail-toggle (button[role=switch])
        │           └── .ag-detail-cat-desc
        ├── .ag-links? (when privacy/cookie policy links configured)
        │   └── .ag-link × N
        └── .ag-branding (REQUIRED when whiteLabel=false; inline !important locked)
            └── a[href=https://kookiok.com, target=_blank, rel=noopener]
                ├── .ag-cookie-mark (SVG, contains .ag-bite + .ag-cr1, .ag-cr2, .ag-cr3)
                └── "KookiOk" text

Understanding why the banner uses two root elements saves debugging time.

This element is the card the visitor sees. It controls:

  • Background color (--surface)
  • Border radius (--radius)
  • Drop shadow (--shadow)
  • Border stroke (--border-style)
  • Mount animation (--animation)
  • Template signature decorations via ::before/::after pseudo-elements

Do not change position or z-index on .ag-banner. The z-index is at 2147483647 (maximum) to ensure the banner appears above any site content.

This element wraps all content sections. It controls:

  • Inner padding (default 22px)
  • Max-width constraints
  • Flex/grid layout of sections

Override padding here if you need a more compact or more spacious layout. Avoid changing overflow — it can clip dropdown menus.

Reading top-to-bottom inside .ag-banner-inner:

OrderElementConditional
1.ag-logoOnly when logoUrl is configured
2.ag-lang-selectOnly when multiple translations available and the language switcher setting shows it
3.ag-content (title + description + GPC notice)Always
4.ag-btns (Reject all, Accept all, Accept selected)Always
5.ag-bar-cats (settings card + chip toggles)Always; a compact banner shows only its Customize button
6.ag-detail (expanded category panel)Hidden until “Customize” is clicked
7.ag-linksOnly when privacy/cookie policy links configured
8.ag-brandingOn the free plan (required, locked); not rendered on a paid plan that removes the KookiOk branding

.ag-logo - rendered only when logoUrl is set in BannerConfig. CSS class: .ag-logo. The logo keeps its own proportions and starts where the content starts. It is at most 32px high and 200px wide, never wider than the banner’s content, and a smaller image keeps its own size: a large square logo shows at 32x32px, a 4:1 logo at 128x32px, a 10:1 logo at 200x20px. To make it larger, raise max-height (and max-width for a wide logo); to center it, set margin-left: auto; margin-right: auto on .ag-banner-inner > .ag-logo. If custom CSS gives the logo’s box a shape of its own (a fixed width, for example), the logo is fitted inside the box without distortion.

.ag-lang-select — rendered only when the banner has more than one translation available. A native <select> element. The “Language switcher on the banner” setting can keep it for visitors who need it (their browser asks for another of the banner’s languages, or none of them fits) or leave it out.

.ag-minimize - rendered before .ag-banner-inner when “Visitors can minimize the banner” is on and the visitor has not decided yet. Pressed, it puts .minimized on .ag-banner and .ag-overlay: the banner becomes a strip with the title, the buttons and the branding, the backdrop is gone, and the page can be used. Nothing is decided by it.

.ag-gpc-notice - rendered while the browser’s Global Privacy Control signal applies to the visitor (the banner’s “Global Privacy Control applies” setting decides where) and its automatic refusal is in force: on the banner a visitor opens from the privacy button to choose themselves. Not rendered once they have made their own choice.

.ag-btns third button (#ag-accept-selected) — the “Accept selected” button is hidden via CSS until the visitor clicks “Customize”, triggering granular mode.

.ag-detail — the full category detail panel. Hidden (aria-hidden="true") until “Customize” is clicked.

.ag-links — rendered only when privacyPolicyUrl or cookiePolicyUrl is set.

The banner maintains semantic ARIA for screen readers:

  • .ag-banner has role="dialog" and aria-modal: "true", or "false" while the page under the banner can be used (the backdrop switched off, or the banner folded)
  • .ag-title is referenced by aria-labelledby
  • .ag-desc is referenced by aria-describedby
  • .ag-detail toggles aria-hidden based on expand state

Do not remove these attributes with CSS — they are required for keyboard navigation and screen reader announcements.