# Wave Theme UI

Source: https://developers.swell.is/storefronts/wave-theme-ui

Wave draws some parts of a storefront itself, outside a theme's sections: the cart drawer, the cookie banner, search suggestions, the notification after an add to cart, cart notices, the bar shown while the next page loads, the skip link and the grid for sidebar groups. A theme can restyle each of them, and can replace the markup of most of them with its own. Wave keeps the behavior: dialogs, focus, keyboard handling, cart requests and consent. Themes still ship no browser JavaScript.

This page is for theme developers. It builds on [Wave](https://developers.swell.is/storefronts/wave-app), which covers sections, templates, design settings and the checks.

What this page describes needs `@swell/wave-theme-core` 1.2.0 or later for its types, its core sections and the `swell theme check` rules. It needs no change on the store: Wave runs the same version for every store.

## Overview

`platform-ui.json` in `@swell/wave-theme-core` lists every name a theme may use in what Wave draws: classes, `data-site-*` attributes and CSS custom properties, each with the core version it arrived in and what it does. The list is versioned (Platform UI v1). Names on it never change within a major version of the core. Anything else Wave draws can change in any release.

- Restyle only names on the list. `swell theme check` warns with `platform_ui` when a section's `styles` name a class of Wave's that isn't listed.
- Never restyle the frame guard's cover, `.uk-frame-cover`, or `.uk-gone`.
- The editor's canvas runs no platform script, so the drawer, suggestions, the Added state, the Added notification and the page-load bar don't show there. Check them on the draft site.

There are three ways to change what Wave draws, from least to most work:

| Way | Where | What it changes |
| --- | --- | --- |
| Tokens and styles | theme/config/settings.json and a section's styles export | The look of what Wave draws. The markup stays Wave's. |
| Overlay templates | theme/templates | A whole piece, such as the cart drawer, built from your own sections. |
| Markup hooks | data-site-* attributes in your sections and layout | The markup of a smaller piece. Wave drives yours and adds none of its own. |

## Tokens and styles

Tokens and section styles change how Wave's pieces look and leave their markup to Wave.

### Frame tokens

The frames Wave draws outside any section take design tokens in `theme/config/settings.json`, beside the theme's colors and fonts. Leave one out to keep Wave's look. Merchants don't see these in the Theme tab.

```json
{
  "format": 1,
  "tokens": {
    "--uk-drawer-width": 480,
    "--uk-drawer-side": "left",
    "--uk-drawer-phone": "sheet",
    "--uk-backdrop-color": "#1f1a17",
    "--uk-backdrop-opacity": 0.55,
    "--uk-progress-color": "#b3541e",
    "--uk-progress-height": 4,
    "--uk-side-width": 320
  }
}
```

| Token | Value | What it sets |
| --- | --- | --- |
| --uk-drawer-width | 280 to 720 (px). 420 when left out. | The cart drawer's width. Never wider than the window. |
| --uk-drawer-side | right or left | The side the cart drawer opens from. |
| --uk-drawer-phone | side or sheet | On phones up to 479 px: at its side, or a sheet from the bottom with round top corners. |
| --uk-backdrop-color, --uk-backdrop-opacity | A color, and 0 to 1 | The backdrop behind the cart drawer and the cookie settings dialog. |
| --uk-progress-color, --uk-progress-height | A color, and 1 to 12 (px) | The page-load bar. |
| --uk-side-width | 160 to 480 (px) | A left or right group's sidebar, from 901 px. |

### Pieces inside your sections

These pieces sit inside a section's markup, so that section's `styles` reach them like any of its own markup.

#### Search suggestions

Wave puts `ul.uk-suggest` right after an `input` with `data-site-suggest`, inside the same section. Each item is `li[role=option] > a` holding `.uk-suggest-image`, `.uk-suggest-name` and `.uk-suggest-price`. The item the arrow keys are on has `[aria-selected="true"]`. The last row, `.uk-suggest-all`, says View all results (Store text `search.view_all`) and goes to the search the input's form sends.

- Properties: `--uk-suggest-bg`, `--uk-suggest-line`, `--uk-suggest-radius`, `--uk-suggest-shadow`, `--uk-suggest-active` and `--uk-suggest-image` (40 px).
- `data-site-suggest="4"` shows at most 4 suggestions. The value is 1 to 6, and an empty value shows 6.
- The list is `position: absolute` in the input's nearest positioned box. Keep it under the input.

To draw the suggestions yourself, see Search suggestions template under Overlay templates.

#### The Added state

For 1.5 seconds after an add, the button that sent it has `data-site-added` and says Store text `cart.added`. In an add button of your own, put the words in an element with `data-site-label`. Wave then changes only those words, for Added and for the stock states, and an icon beside them stays. Without one, Wave changes the button's whole text.

```tsx
<button type="submit">
  <Icon name="bag" />
  <span data-site-label>Add to cart</span>
</button>
```

```css
& [data-site-added] { background: var(--uk-color-success); }
```

To show the state with your own markup, see The Added state under Markup hooks.

#### The line being added

An add shows the new line at once, after your cart section's last line, until the cart's own line takes its place. Adding a product that is already in the cart raises its quantity instead. The line is `.uk-cart-preview`, with `.uk-cart-preview-media`, `.uk-cart-preview-info` (`.uk-cart-preview-name`, `.uk-cart-preview-options`, `.uk-cart-preview-price`), `.uk-cart-preview-total` and `.uk-cart-preview-qty`. Restyle it from the section that shows your lines so nothing moves when the cart answers: `--uk-cart-preview-image` is its photo size (72 px) and `--uk-cart-preview-line` the line under it.

#### Cart loading

While Swell answers a cart change, only the amounts being decided show as loading, and Checkout can't be clicked. The same applies to quantity changes, removing a line and coupons, in the drawer and on the cart page.

- An amount from ui-kit's `CartAmount` (`[data-site-cart-amount]`) has `.uk-cart-loading`, a shimmer. Its colors are `--uk-cart-loading` and `--uk-cart-loading-shine`.
- The Checkout link, `a[href="/checkout"]`, has `.uk-cart-wait`, `aria-busy="true"` and `aria-disabled="true"` while a cart write is unanswered.

```css
& [data-site-cart-amount].uk-cart-loading { border-radius: 2px; }
& a[aria-busy="true"] { opacity: .6; }
```

#### Page loads, choices and photos

- What was clicked to load the next page has `[data-site-pending]`, and `<html>` has `[data-site-navigating]`.
- A variant choice has `[data-site-available]`, and `.uk-choice--unavailable` when nothing is left to buy with it.
- An `img.uk-image` that failed to load has `[data-site-broken]`.
- A `[data-site-zoom]` photo has `[data-zoomed]` while zoomed, and reads `--uk-zoom-x` and `--uk-zoom-y`.
- `--uk-header-sticky` is your sticky header's height, measured by Wave. Add it to the top of your own sticky pieces. Never set it.

Wave opens a once-per-device prompt (`[data-site-once]`, such as ui-kit's `AgeGate`) in its dialog where you rendered it, so the styles around it still apply.

## Overlay templates

An overlay template is a template with no address of its own. Wave shows its sections over other pages, in place of what it would draw itself. All four are optional, and the core ships none of them: a theme without the file gets Wave's own piece.

| Template | Replaces | Core section to start from |
| --- | --- | --- |
| theme/templates/cart-drawer.json | The cart drawer | cart_drawer_head, with cart_items and cart_summary |
| theme/templates/cookie-banner.json | The cookie banner | cookie_banner |
| theme/templates/search-suggest.json | Search suggestions | search_suggest |
| theme/templates/cart-added.json | The notification after an add to cart | cart_added |

- An overlay template has no section groups: no `groups` or `hidden_groups`.
- Its sections' styles ride on the pages it shows over. They count with the section groups' styles, at most 32 KB together (`group_styles`).
- `swell theme check` and Wave refuse an overlay template that breaks its rules, with rule `template`.

### Cart drawer

The cart drawer opens after an add, while the theme's cart setting says so (see After adding to cart), and from a cart icon that opens it. Without a template it shows the cart page's cart sections, made compact by Wave. With `theme/templates/cart-drawer.json` it shows that template's sections as they are, so you choose what is in it, in what order and how it looks.

```json
{
  "title": "Cart drawer",
  "sections": [
    { "id": "drawer-head", "type": "cart_drawer_head", "props": {} },
    { "id": "drawer-items", "type": "cart_items", "props": {} },
    { "id": "drawer-summary", "type": "cart_summary", "props": {} }
  ]
}
```

- The template needs at least one section with a cart field, such as the core's `cart_items`. Its page kind is the cart's, so cart fields, cart products and cart cross-sells work in it.
- Sections render with `site.page.drawer` true. Lay them out for a 420 px panel there. The core's sections do: `cart_items` drops its page heading and uses small quantity controls, and `cart_summary` becomes the drawer's foot with the totals and Checkout.
- In the drawer, `--uk-gutter` is the drawer's gutter, and the section spacing tokens and heading sizes are smaller. Nothing else of Wave's applies to your sections.
- Once the template exists, changes to the cart page no longer reach the drawer. Merchants can make the template in the editor with **Customize cart drawer**.
- In the editor, the Cart drawer card shows the drawer open over a dimmed page with a sample cart.

ui-kit's parts carry the hooks Wave reads. Render the hooks through them, never by hand:

| Part | What it is |
| --- | --- |
| CartDrawerHead | The head: a title, the item count, an optional line under the title and the close button. Its section stays at the drawer's top while the rest scrolls, and it holds the slot where Wave says a change didn't work. The core section cart_drawer_head renders it. |
| CartDrawerClose | A close button anywhere in the drawer. Without one, Wave shows its own at the top corner. |
| CartDrawerFoot | The foot, in a section of its own that stays at the drawer's bottom: the totals (CartTotals) and the Checkout link. |
| CartQuantity, CartAmount | Lines and amounts, as on the cart page, so an add shows at once and the answer moves nothing. |

```tsx
<CartDrawerHead labels={{ title: t('cart.title'), close: t('common.close') }}>
  {/* children show under the title */}
</CartDrawerHead>
```

`CartDrawerHead` and `CartDrawerFoot` render Wave's drawer classes: `.uk-drawer-head`, `.uk-drawer-title`, `.uk-drawer-count`, `.uk-drawer-close` and `.uk-drawer-foot`. Restyle them from the sections that render them.

#### The cart icon

`<CartLink label={t('cart.title')} opens="drawer" />` opens the drawer instead of the cart page, while an add opens the drawer. Otherwise, and without scripts, it is a link to `/cart`. The core header has a setting for it: `cart_link`, `page` or `drawer`.

### After adding to cart

A theme can let merchants choose what an add to cart does: open the cart drawer, go to the cart page, or show a notification. Declare a `select` or `radio` in `theme/config/settings_content.json` marked `"controls": "cart_after_add"`, with option values among `drawer`, `page` and `notification`:

```json
{
  "id": "cart_after_add",
  "label": "After adding to cart",
  "type": "select",
  "default": "drawer",
  "controls": "cart_after_add",
  "options": [
    { "value": "drawer", "label": "Open the cart drawer" },
    { "value": "page", "label": "Go to the cart page" },
    { "value": "notification", "label": "Show a notification" }
  ]
}
```

- Wave reads the mark, never the setting's id. One setting can carry it, and a retired one can't. Without it, or at `drawer`, an add opens the drawer.
- `page`: add forms post as they do without JavaScript and land on the cart page. An add on the cart page still updates it in place.
- `notification`: Wave shows a small panel at once with the line being added, View cart with the count, Checkout and a close button. It stays until the shopper closes it, and says so when an add fails. Its words are Store text `cart.added_title`, `cart.view_cart` and `cart.checkout`, and its look follows the theme's design tokens.

#### Your own Added notification

To draw the notification yourself, ship `theme/templates/cart-added.json`. While the cart setting says `notification`, every page with an add form carries the template's sections hidden. After an add, Wave fills their slots from the add form and shows them in place of its own panel.

```json
{
  "title": "Added to cart notification",
  "sections": [
    { "id": "cart-added", "type": "cart_added", "props": { "position": "top" } }
  ]
}
```

The core section `cart_added` is a card under the sticky header at the top right (`position: top`) or at the bottom right (`bottom`, a sheet on a phone). It shows a check and the title, the line added, an optional `note` under it, View cart with the count, Checkout and Continue shopping.

A section of your own renders with `site.page.added` true and should render nothing without it. Wave puts the sections in a layer the size of the window that lets clicks through to the page. Place your panel in it with `position: absolute`. Wave keeps when it shows, the dialog, focus, Escape, a click outside and the error case. The hooks come from ui-kit's parts:

| Part | Hook | What it does |
| --- | --- | --- |
| CartAddedTitle | data-site-added-title | Required. Wave puts the title there, or what went wrong. |
| CartAddedClose | data-site-added-close | Required. Closes the notification, which never closes by itself. Any element with the hook closes it. |
| CartAddedSlot | data-site-added-slot | name is image, name, options or price. Filled at once from the add form, and hidden when the add has none. |
| CartAddedCount | data-site-added-slot="count" | The label with the cart's count in place of {count}. |

- A Checkout link, `<a href="/checkout">`, is marked busy until the cart answers, as in the drawer.
- On an error Wave sets `data-site-added-error` on each of the template's sections: `&[data-site-added-error] .actions { display: none; }`.
- The check refuses a `cart-added.json` whose visible sections render no title or no close button, name a slot Wave doesn't fill, or hold a cart field. The template renders with each page, where the shopper's cart isn't read.

### Cookie banner

Wave adds the store's cookie banner to every page while the storefront's Cookie banner setting is on. That is the merchant's choice, never the theme's. Without a banner of the theme's own, Wave's shows, styled by the theme's design tokens. Its words are Store text area `consent`.

A theme's own banner goes in `theme/templates/cookie-banner.json`. The template holds one section, which either renders ui-kit's `ConsentBanner` once or draws the banner in its own markup with Wave's hooks. What the banner asks, the cookie, the consent rules, when it shows, focus and Escape stay Wave's either way.

Never build a cookie, consent or privacy banner in any other section, template or the layout. A second one would ask twice and control nothing.

#### With ConsentBanner

The core `cookie_banner` section is the simplest way. Its `layout` is `bar` (edge to edge), `box` (a card in the middle) or `corner` (a card in the corner where lines start), and its `position` is `bottom` or `top`:

```json
{
  "title": "Cookie banner",
  "sections": [
    { "id": "cookie-banner", "type": "cookie_banner", "props": { "layout": "corner", "position": "bottom" } }
  ]
}
```

Or write a section that renders `<ConsentBanner layout="corner" position="bottom" labels={consentLabels(t)} site={site} />` and restyle it with the section's `styles` on the Platform UI names: `.uk-consent`, `.uk-consent--bar`, `.uk-consent--box`, `.uk-consent--corner`, `.uk-consent--top`, `.uk-consent-bar`, `.uk-consent-copy`, `.uk-consent-title`, `.uk-consent-text`, `.uk-consent-actions`, `.uk-consent-dialog` and its parts, and the buttons by `[data-consent]` (`all`, `none`, `edit`, `save`, `close`). The banner's position comes from its layout, so never set `position: fixed` on it yourself.

To draw the banner in markup of your own, see Cookie banner markup under Markup hooks.

### Search suggestions template

With `theme/templates/search-suggest.json`, the suggestions under a search box are that template's sections, rendered for what the shopper typed. You choose what shows, its markup and its look. Wave keeps the combobox: when to ask (250 ms after typing, 2 to 64 characters), the request and its caching, ARIA, the arrow keys, Enter, Escape and closing on a click elsewhere.

```json
{
  "title": "Search suggestions",
  "sections": [
    {
      "id": "suggestions",
      "type": "search_suggest",
      "props": {
        "products": { "from": "search", "limit": 5 },
        "categories": { "from": "top", "limit": 24 },
        "category_count": "3",
        "prices": "show",
        "width": "wide"
      }
    }
  ]
}
```

- The template's page kind is the search's. A `product_list` field `{ "from": "search" }` is the shopper's search, and its `query` is what they typed. Its sections render with no layout.
- The core `search_suggest` section shows matching top categories as chips (`category_count`: 0, 2, 3 or 4), product rows with the photo, name, category and price (`prices`: `show` or `hide`), View all results with the count, and a line when nothing matches. `width` is `wide` (at least 460 px where the window allows) or `box` (as wide as the search box).
- Its words are Store text `search.suggest_products`, `search.suggest_categories`, `search.view_all`, `search.suggest_empty` and `search.suggest_hint`.

In a section of your own, mark each suggestion with `data-site-suggest-option=""`: a link, or an element holding one. Mark View all results too. Wave makes them the combobox's options in page order, with `role="option"` and `aria-selected="true"` on the one the arrow keys are on. Style that state: it is the keyboard focus. Enter follows the option's link. Render `null` when the list has no query, and words when it has no products. The template needs at least one option.

```tsx
import type { ProductList, Translate } from 'ui-kit';
import { Image, Price } from 'ui-kit';

export const schema = {
  label: 'Quick results',
  fields: [{ id: 'products', type: 'product_list', label: 'Products', max: 8, default: { from: 'search', limit: 4 } }],
} as const;

export const styles = `
& .qr { margin-top: 6px; padding: 8px; border-radius: var(--uk-radius-md); background: var(--uk-color-surface); box-shadow: var(--uk-shadow-raised); }
& .qr a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--uk-radius-sm); color: inherit; text-decoration: none; }
& .qr [aria-selected="true"], & .qr a:hover { background: var(--uk-color-muted-bg); }
& .qr .uk-image { width: 48px; height: 48px; border-radius: var(--uk-radius-sm); }
`;

export default function QuickResults({ t, products }: { t: Translate; products?: ProductList | null }) {
  if (!products?.query) return null;
  return (
    <div className="qr">
      {products.items.map((p) => (
        <a key={p.id} href={p.url} data-site-suggest-option="">
          {p.image ? <Image image={p.image} alt="" sizes="48px" /> : null}
          {p.name} <Price price={p.price} compare={p.compare_at} />
        </a>
      ))}
      {products.items.length
        ? <a href={`/search?q=${encodeURIComponent(products.query)}`} data-site-suggest-option="">{t('search.view_all')}</a>
        : <p>{t('search.suggest_empty', { query: products.query })}</p>}
    </div>
  );
}
```

- Wave's panel, `div.uk-suggest-panel`, holds your sections right after the input: `position: absolute` under the input's nearest positioned box, as wide as it. Set the panel's background, border, shadow and width in your section.
- With your suggestions, a page keeps ui-kit's rules for `Image`, `Price` and `Icon`. Build everything else in the panel from your section's own classes and styles.
- The editor has no card for this template yet. Check it on the draft site.

## Markup hooks

A hook is a `data-site-*` attribute on markup the theme draws. Where a theme renders the hook, Wave drives that markup and adds none of its own. Without it, Wave draws its own piece. Every hook is listed in `platform-ui.json`.

### The Added state

To keep Wave from changing the words at all, put `data-site-added-swap="off"` on the button, or an element with `data-site-added-show` inside it. Wave then only sets `data-site-added` on the button, and your markup and CSS show the state:

```tsx
<button type="submit" className="add">
  <span data-site-label>{t('product.add_to_cart')}</span>
  <span data-site-added-show><Icon name="check" size={16} /> {t('cart.added')}</span>
</button>
```

```css
& .add [data-site-added-show] { display: none; }
& .add[data-site-added] [data-site-added-show] { display: inline-flex; }
& .add[data-site-added] [data-site-label] { display: none; }
```

### Cookie banner markup

Draw the banner and its settings yourself and mark their parts. Wave drives them exactly as it drives `ConsentBanner`: it shows the banner to a shopper who hasn't answered, opens and closes the settings, sets the switches to the current choice, keeps the answer and decides which scripts run. Write each hook with `=""`. A bare attribute renders as `"true"`, which Wave refuses.

| Hook | On | What it does |
| --- | --- | --- |
| data-site-consent-banner | The first layer: one element with hidden and a name (aria-label or aria-labelledby). Optional data-site-consent-saved={words}. | Shown to a shopper who hasn't answered, hidden after an answer. Never modal. |
| data-site-consent-accept, data-site-consent-reject | A <button type="button"> each, once in the banner. | Accept all and Reject all. |
| data-site-consent-customize | A <button type="button"> in the banner. | Opens the settings. |
| data-site-consent-prefs | A <dialog> after the banner, never inside it and never open, with a name. | The settings. Wave opens it modally where you rendered it, keeps focus inside, and Escape closes it. |
| data-site-consent-category | An <input type="checkbox"> in the settings, never checked: analytics, marketing and preferences once each. sale_of_data may be added. | The category's switch, set to the current choice when the settings open. |
| data-site-consent-save, data-site-consent-close | A <button type="button"> each, in the settings. | Save choices, and close. Accept all and Reject all may also sit in the settings: both or neither. |

```tsx
import type { SiteInfo, Translate } from 'ui-kit';
import { CONSENT_WORDS, consentLabels } from 'ui-kit';

export const schema = { label: 'Cookie note', fields: [] } as const;

export const styles = `
& .note { position: fixed; bottom: 16px; left: 16px; z-index: 2147483500; width: min(420px, calc(100% - 32px)); padding: 20px; border-radius: var(--uk-radius-lg); background: var(--uk-color-surface); color: var(--uk-color-ink); box-shadow: var(--uk-shadow-raised); }
& .note-choices, & .prefs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
& .note-more { margin-top: 8px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
& .prefs { width: min(520px, calc(100% - 32px)); padding: 24px; border: 0; border-radius: var(--uk-radius-lg); background: var(--uk-color-surface); color: var(--uk-color-ink); }
& .prefs-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--uk-color-line); }
& .prefs-save { grid-column: 1 / -1; }
`;

type Props = { site?: SiteInfo; t: Translate };
const SWITCHES = ['analytics', 'marketing', 'preferences'] as const;

export default function CookieNote({ site, t }: Props) {
  const own = consentLabels(t);
  const w = (k: keyof typeof CONSENT_WORDS) => own[k] || CONSENT_WORDS[k];
  const privacy = site?.store?.policies?.find((p) => p.id === 'privacy');
  return (
    <>
      <section className="note" data-site-consent-banner="" aria-labelledby="note-title" data-site-consent-saved={w('saved')} hidden>
        <h2 id="note-title">{w('title')}</h2>
        <p>{w('text')}{privacy?.url ? <> <a href={privacy.url}>{w('privacy_link')}</a></> : null}</p>
        <div className="note-choices">
          <button type="button" className="uk-button uk-button--primary" data-site-consent-accept="">{w('accept')}</button>
          <button type="button" className="uk-button uk-button--primary" data-site-consent-reject="">{w('reject')}</button>
        </div>
        <button type="button" className="note-more" data-site-consent-customize="">{w('customize')}</button>
      </section>
      <dialog className="prefs" data-site-consent-prefs="" aria-labelledby="prefs-title">
        <h2 id="prefs-title">{w('customize_title')}</h2>
        <p>{w('customize_text')}</p>
        <div className="prefs-row"><span>{w('essential')}</span><span>{w('always_on')}</span></div>
        {SWITCHES.map((k) => (
          <div key={k} className="prefs-row">
            <label htmlFor={`prefs-${k}`}>{w(k)}</label>
            <input type="checkbox" role="switch" id={`prefs-${k}`} data-site-consent-category={k} />
          </div>
        ))}
        <div className="prefs-actions">
          <button type="button" className="uk-button uk-button--primary prefs-save" data-site-consent-save="">{w('save')}</button>
          <button type="button" className="uk-button uk-button--secondary" data-site-consent-accept="">{w('accept')}</button>
          <button type="button" className="uk-button uk-button--secondary" data-site-consent-reject="">{w('reject')}</button>
        </div>
        <button type="button" className="note-more" data-site-consent-close="">{w('close')}</button>
      </dialog>
    </>
  );
}
```

The template for it is `{ "title": "Cookie banner", "sections": [{ "id": "cookie-note", "type": "cookie_note", "props": {} }] }`. A section's `styles` can use `position: fixed` for a cookie banner of its own markup.

#### Rules Wave checks

Wave checks a banner of your own markup against these rules. When one breaks, Wave refuses the write, and on the storefront it shows its own banner instead of yours. Swell's theme review checks the same.

- Accept all and Reject all are both in the banner, once each: the same element with the same classes, inline style and inner markup, side by side or one above the other in alike wrappers, and in view. Neither is inside `hidden`, `aria-hidden`, `inert`, a closed `<details>` or an inline style that hides it.
- Customize is in the banner, and the settings offer analytics, marketing and preferences, unticked, with Save choices and a close button.
- The banner is never a wall: nothing `inert`, no `role="dialog"` or `aria-modal` on the first layer, no fixed element over the whole window, and no `box-shadow` or `outline` the size of the window.
- Styles restyle Accept all and Reject all only together, by the class they share. Never by their hooks, by position such as `:first-child`, by a sibling selector, an id or an attribute only one has. Never `display: none`, `visibility: hidden` or `opacity: 0` on them, and never `!important` on `display` in the banner's styles.
- The hooks belong to the cookie banner template's section only. `swell theme check` refuses a page template or group that shows the section.

`swell theme check` refuses a `cookie-banner.json` whose section neither renders `ConsentBanner` nor draws a banner with every hook (it names the missing ones), does both, holds more than one section, or names section groups.

### Notices

An element with `data-site-notice-slot` is where Wave's notices go: the note that a cart change didn't work, and an app form's answer. It can sit in a section, a group, the layout or your cart drawer. Without a slot, notices go where Wave puts them by default.

In the slot, a notice is Wave's `.uk-notice` (`.uk-notice--error` for an error), which your section's styles reach. To use your own markup, render ui-kit's `NoticeTemplate` with one element inside. Wave puts the words in its empty `data-site-notice-text` element and sets `data-site-notice` to the tone: `error`, `info` or `success`.

```tsx
<div className="notes" data-site-notice-slot="" />
<NoticeTemplate>
  <p className="note"><Icon name="shield" size={16} /><span data-site-notice-text="" /></p>
</NoticeTemplate>
```

```css
& .note { display: flex; gap: 8px; padding: 12px 14px; border-radius: var(--uk-radius-sm); background: var(--uk-color-muted-bg); }
& .note[data-site-notice="error"] { color: var(--uk-color-sale); }
```

### Page-load bar and skip link

Wave shows a bar at the top of the window while the next page loads. The frame tokens set its color and height. To draw your own, put an element with `data-site-progress` in the layout or a group. Wave sets the attribute to `start` while the next page loads and to `done` when that load is given up, and adds no bar of its own.

ui-kit's `<PageLoadBar />` is one: a hairline at the window's top in the progress tokens, or the accent color at 2 px. The core header renders it when its `load_bar` setting is `line`. One of your own, in a header group section:

```tsx
<div className="bar" data-site-progress="" aria-hidden="true" />
```

```css
& .bar { position: fixed; top: 0; left: 0; z-index: 2147483646; width: 100%; height: var(--uk-progress-height, 2px); opacity: 0; transform: scaleX(0); transform-origin: 0 50%; background: var(--uk-progress-color, var(--uk-color-accent)); pointer-events: none; }
& .bar[data-site-progress="start"] { opacity: 1; animation: grow 9s cubic-bezier(.08, .75, .2, 1) .15s both; }
& .bar[data-site-progress="done"] { transform: scaleX(1); transition: transform .18s, opacity .3s .18s; }
@keyframes grow { to { transform: scaleX(.94); } }
```

Start the animation after 150 ms so a page that loads at once never flashes the bar, and respect reduced motion.

A page whose layout or sections hold an element with `data-site-skip` gets no skip link from Wave. Make yours the first focusable element, a link to `#main-content` that is visible on focus, and keep `id="main-content"` where your content starts:

```tsx
<a href="#main-content" className="skip" data-site-skip="">{t('navigation.skip')}</a>
```

### Sidebars

Wave lays out a page's `left` and `right` section groups beside its own sections, in a grid as wide as `--uk-side-width`, and under them on a phone. A theme layout can place a group itself: render ui-kit's `<GroupSlot place="left" />` (or `"right"`) exactly once, only when `site.groups.left` (or `.right`) says the page shows one. Wave puts the group's sections in the slot and lays out no grid for it.

```tsx
import type { ReactNode } from 'react';
import type { SiteInfo } from 'ui-kit';
import { GroupSlot } from 'ui-kit';

export default function Layout({ site, children }: { site: SiteInfo; children: ReactNode }) {
  if (!site.groups?.left) return <>{children}</>;
  return (
    <div style={{ display: 'flex', alignItems: 'stretch' }}>
      <aside className="uk-hide-sm" style={{ flex: '0 0 var(--uk-side-width, 248px)', borderInlineEnd: '1px solid var(--uk-color-line)' }}>
        <div style={{ position: 'sticky', top: 0, maxHeight: '100vh', overflowY: 'auto' }}>
          <GroupSlot place="left" />
        </div>
      </aside>
      <div style={{ flex: '1 1 0', minWidth: 0 }}>{children}</div>
    </div>
  );
}
```

- The layout wraps the whole page, header and footer groups included, so the slot sits beside the page as a rail.
- A layout has no `styles`. Use inline styles, tokens and ui-kit's classes, such as `uk-hide-sm`, which hides under 900 px.
- A group you don't place stays in Wave's grid. The editor's canvas shows Wave's grid either way, so check the draft site.
