Interaction
Navigation
The nav is assembled from real elements; its look is the design system’s, and its breakpoint is one site setting.
A navigation in sitereal is not one element with a settings panel behind it. It is a group of ordinary elements, assembled — which is why you can restyle any part of it without asking us for a setting.
Inserting one
Insert Nav and you get the whole assembled menu: a bar, a list, items, links, a dropdown with a trigger and a submenu, a mobile toggle with a burger, a panel, a close button, a scrim and a skip link. Every one of them is a real child node you can select, move, delete or restyle.
The other fifteen nav elements are in the insert menu on their own, for when you want to add one more link or a second dropdown to a menu you already have.
What it looks like
What a menu looks like is the design system’s Navigation module (Design → Navigation): a block of the generated stylesheet in which every selector is wrapped in :where(), so it has zero specificity. Nothing is written into your stylesheet when you insert a Nav, and a bare one still looks like a nav.
.site-header__link {
color: var(--text-color);
padding-inline: var(--space-s);
&:hover { color: var(--primary); }
}So a class on a part is the whole of restyling it. Put .site-header__link on the links and style it — hover and open states included — and it wins outright, because the defaults it competes with weigh nothing. Generate BEM classes on the nav and every part gets one: six items share __item, the links share __link.
There are two layers. What a menu needs to work — a closed flyout hidden, the mobile panel off the screen, the scrim — is emitted whatever you switch off. Its look is what the Navigation switch takes away, and with the design system off it draws in the values your tokens resolve to.
A project that already holds the old starter rules — written against [builder-data-element="nav-link"] by earlier versions — keeps them, and they simply outrank the defaults. The Navigation screen lists them under Old starter rules and removes the ones you never changed.
Two attributes, two contracts
| Attribute | Read by | Editable |
|---|---|---|
builder-data-element | your CSS, the design system | yes — it says what a part is |
data-nav-part | public/scripts/nav.js | no — do not invent or remove it |
nav.js does the behavior and the accessibility wiring: it pairs each trigger with a real id/aria-controls, keeps aria-expanded honest, traps focus only while a panel is modal, closes on Escape, locks scroll, and marks the current page with aria-current.
The settings a menu has
A menu’s settings are asked on the element they are about, in the Element panel next to Classes: the menu’s on the nav, a dropdown’s on the dropdown. Every answer is per element — a header and a sidebar menu on one site want different ones. Nothing is stored beside the page: each setting is an attribute or a part of the tree.
Collapse and the mobile menu
Where a menu collapses is one site setting, under Design → Navigation — a media query cannot read an attribute, so the width has to be the site’s. The nav’s Collapse row reads it and takes you there.
| Option | Means |
|---|---|
| At a breakpoint | a bar above it, a menu below — the default, at 900px |
| Always | the mobile menu at every width |
| Never | the bar at every width, no toggle |
Mobile menu, on the nav, is how the panel comes in: a drawer from the end edge (the default), from the start, from the top, a sheet from the bottom, or full screen. The toggle stays on top as the close button.
Style: flyout, mega, side, inline, full
On a dropdown, Style is what it opens as. Flyout is a list under the trigger. Mega menu wraps the submenu in a real nav-mega panel you can fill with columns. Side hangs beside the trigger — a submenu inside a submenu. Inline folds open in place, an accordion for sidebars and footers. Full is a mega panel from edge to edge of the screen. Below the breakpoint every style folds back into the mobile list.
Folding a mega menu back unwraps that column, and is refused rather than made lossy once the panel holds more than one.
Opens on
Hover and click, unless you say otherwise.
- Click takes the hover out — for a panel too big to open in passing.
- Hover takes the click out — clicking a menu the pointer is still inside would shut it under the cursor.
Neither can be the whole story, so a hover dropdown still opens on a tap, in the mobile menu, and on Enter / ArrowDown. A dropdown you cannot open is not a setting.
Hangs from
A flyout’s alone: Start (and it flips itself at the screen edge), Center, or End. Setting it also calls off the script’s measured flip, because you have said where it goes.
Show it open
A canvas-only preview. It stamps the real data-nav-open, so what you style is the menu as it truly opens, in your own rules. It is never saved into a page.
The breakpoint is one setting
The script has no breakpoint of its own: a menu is mobile exactly when its toggle is visible. So the site’s setting moves every menu at once, and a menu that should collapse somewhere else says so with a display on its own toggle class — no setting needed.