Components
Navigation
The persistent header: brand, primary links and a slot for controls.
Overview
The header on every page of this site, including the one above, is this component. It is the only primary navigation on a page, so its presentation is a system choice rather than a per-instance one.
When to use
- As the single persistent route between the main parts of the site.
When not to use
- For in-page tables of contents or secondary menus (the documentation sidebar is its own pattern).
Preview and properties
System property
The system presentation is "…" (change it in System Studio). The preview below can show another.
Component properties
Navigation is a single persistent landmark, so it has no per-instance override on the site. The controls slot (System Studio entry, theme toggle) is empty in this preview.
---
const items = [
{ href: '/#work', label: 'Work', index: '01' },
{ href: '/#system', label: 'Anatomy', index: '02' },
{ href: '/design-system', label: 'Design System', index: '03' },
{ href: '#contact', label: 'Contact', index: '04' },
];
---
<Navigation items={items}>
<HeaderControls slot="controls" client:load />
</Navigation><header class="site-header" data-component="navigation">
<div class="site-header__inner">
<a class="wordmark" href="#" data-part="brand">
<img class="wordmark__logo" src="/brand/logo.svg" alt="" width="36" height="36" data-part="logo" />
<span class="wordmark__name">Nino Vujasinović</span>
<span class="wordmark__role label">Senior Product Designer</span>
</a>
<nav aria-label="Primary" class="site-nav" data-part="links">
<ul>
<li>
<a href="/#work" data-part="link">
<span class="site-nav__n label" data-part="index" aria-hidden="true">01</span>Work</a>
</li>
<li>
<a href="/#system" data-part="link">
<span class="site-nav__n label" data-part="index" aria-hidden="true">02</span>Anatomy</a>
</li>
<li>
<a href="/design-system" data-part="link" data-featured aria-current="page">
<span class="site-nav__n label" data-part="index" aria-hidden="true">03</span>
<svg class="icon" data-part="featured-icon" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"/>
<path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"/>
<path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"/>
</svg>Design System</a>
</li>
<li>
<a href="#contact" data-part="link">
<span class="site-nav__n label" data-part="index" aria-hidden="true">04</span>Contact</a>
</li>
</ul>
</nav>
<div class="hc" data-part="controls">
</div>
</div>
</header>Presentations
Five presentations, chosen in System Studio (data-nav) and rendered here by the real component. Every one keeps the same destinations in the same order:
Minimal is transparent over the hero and turns solid after the first scroll. Boxed groups the links in a bordered strip and is always solid. Floating detaches the bar from the edges with a radius and shadow. Centered puts the brand on the axis with the links and controls on a second row (from 80rem up, with a taller bar from the nav.height-tall token; below that it is a single row like Minimal). Split puts the brand left, the links centred between and the controls right, on a solid bar with a heavier rule. Over the full-bleed hero the transparent bar uses the dark roles until the page scrolls and it turns solid.
Anatomy
- 1Container. The
headerlandmark. - 2Brand. Name and role; always links to the top of the home page.
- 3Links. The primary
navlandmark with its own label. - 4Link. The current page carries
aria-current. - 5Index. Optional number, decorative (
aria-hidden). - 6Controls slot. Site controls: System Studio entry, theme, reset. Empty in this preview.
Tokens
| Component token | References | Resolved (dark) | Resolved (light) |
|---|---|---|---|
{layout.nav-height} | 4rem | 4rem | |
{color.bg.page} | #0C0C0C | #EAE9E7 | |
{color.border.subtle} | #EAE9E724 | #0C0C0C24 | |
2.75rem | 2.75rem | 2.75rem | |
{space.inline.md} | calc(16px * 1) | calc(16px * 1) | |
{prim.space.3} | 12px | 12px | |
{radius.control} | 2px | 2px | |
{elevation.overlay} | 0px 24px 64px -16px #00000066 | 0px 24px 64px -16px #00000066 | |
{color.border.strong} | #EAE9E78C | #0C0C0C8C | |
6.25rem | 6.25rem | 6.25rem | |
2.25rem | 2.25rem | 2.25rem | |
1.75rem | 1.75rem | 1.75rem | |
{color.border.strong} | #EAE9E78C | #0C0C0C8C | |
color-mix(in srgb, {color.accent.fill} 26%, transparent) | color-mix(in srgb, #B9A6FF 26%, transparent) | color-mix(in srgb, #B9A6FF 26%, transparent) | |
color-mix(in srgb, {color.accent.fill} 42%, transparent) | color-mix(in srgb, #B9A6FF 42%, transparent) | color-mix(in srgb, #B9A6FF 42%, transparent) | |
{color.text.primary} | #EAE9E7 | #0C0C0C | |
{color.accent.text} | #B9A6FF | #0C0C0C | |
{prim.font.weight.semibold} | 600 | 600 |
Guidelines
Do
- Keep three to five links.
- Label the landmark (
aria-label) so screen-reader users can tell it from other navs. - Mark the current page.
Do not
- Hide essential navigation behind a menu button on desktop.
- Use colour alone to show the current page.
Limitation: there is no mobile menu. At small widths the link list is hidden and the controls remain; the routes are reachable from the page content and footer. A collapsible menu is proposed, not implemented.
Accessibility
| Topic | Behaviour |
|---|---|
| Landmarks | header containing a labelled nav. A skip link precedes it on every page. |
| Keyboard | Links are native anchors in a list; Tab moves through brand, links, then controls. |
| Current page | aria-current plus a visible underline (or inverted block in the boxed presentation), not colour alone. |
| Target size | Links and brand are at least 44px high. |
| Contrast | Link text uses color.text.primary over the page or raised surface, validated at 4.5:1. |
Code and API
| Property | Type | Default | Scope | Description |
|---|---|---|---|---|
items | { href, label, index? }[] | — | component | The primary links. |
current | string | — | component | href of the current page; sets aria-current. |
showIndex | boolean | true | component | Shows the decorative index numbers. |
variant | 'inherit' | 'minimal' | 'boxed' | 'floating' | 'centered' | 'split' | 'inherit' | system | Defaults to the system presentation. |
preview | boolean | false | preview only | Renders in normal flow for documentation. |
slot "controls" | slot | — | component | Interactive site controls. |
import Navigation from '../components/ui/Navigation.astro';
import HeaderControls from '../components/islands/HeaderControls';
<Navigation items={items} current="/design-system">
<HeaderControls slot="controls" client:load />
</Navigation>Presentation variants are CSS keyed by data-nav on the root element, so they apply to every page without touching the component.