Navigation Menu
A Brutalist navigation bar with bold borders, hard-shadow disclosure panels, and native destination links.
Brutalist Navigation Menu builds site- or app-level navigation following the Brutalist design contract (rounded-base 5px corners, 2px black borders, DM Sans typography, and a 3px hard-offset floating panel shadow) with mutually exclusive panels and real native anchor links.
Preview
Section titled “Preview”<brutalist-navigation-menu-root id="brutalist-nav-hero">
<brutalist-navigation-menu-trigger
data-nav-part="trigger"
data-value="getting-started"
>
Getting started ▾
</brutalist-navigation-menu-trigger>
<brutalist-navigation-menu-content
data-nav-part="content"
data-value="getting-started"
>
<div class="grid gap-1 w-[360px] p-1">
<brutalist-navigation-menu-link data-nav-link="intro">
<span class="grid gap-1 text-left">
<span class="block text-sm font-medium leading-none">
Introduction
</span>
<span class="block text-xs opacity-80">
Re-usable components built with Proto UI prototypes.
</span>
</span>
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-link data-nav-link="install">
<span class="grid gap-1 text-left">
<span class="block text-sm font-medium leading-none">
Installation
</span>
<span class="block text-xs opacity-80">
How to install adapters and structure your app.
</span>
</span>
</brutalist-navigation-menu-link>
</div>
</brutalist-navigation-menu-content>
<brutalist-navigation-menu-trigger
data-nav-part="trigger"
data-value="components"
>
Components ▾
</brutalist-navigation-menu-trigger>
<brutalist-navigation-menu-content
data-nav-part="content"
data-value="components"
>
<div class="grid gap-1 sm:grid-cols-2 w-[480px] p-1">
<brutalist-navigation-menu-link data-nav-link="alert-dialog">
Alert Dialog
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-link data-nav-link="tabs">
Tabs
</brutalist-navigation-menu-link>
</div>
</brutalist-navigation-menu-content>
<brutalist-navigation-menu-trigger
data-nav-part="trigger"
data-value="resources"
>
Resources ▾
</brutalist-navigation-menu-trigger>
<brutalist-navigation-menu-content
data-nav-part="content"
data-value="resources"
>
<brutalist-navigation-menu-link data-nav-link="changelog">
Changelog
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-item data-nav-item="search">
Search documentation
</brutalist-navigation-menu-item>
</brutalist-navigation-menu-content>
</brutalist-navigation-menu-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#brutalist-nav-hero');
setElementProps(root, { a11yLabel: 'Main navigation' });
root.querySelectorAll('[data-nav-part]').forEach((el) => {
setElementProps(el, { value: el.getAttribute('data-value') });
});
setElementProps(root.querySelector('[data-nav-link="intro"]'), {
href: '#introduction',
current: true,
});
setElementProps(root.querySelector('[data-nav-link="install"]'), {
href: '#installation',
});
setElementProps(
root.querySelector('[data-nav-link="alert-dialog"]'),
{ href: '#alert-dialog' }
);
setElementProps(root.querySelector('[data-nav-link="tabs"]'), {
href: '#tabs',
});
setElementProps(
root.querySelector('[data-nav-link="changelog"]'),
{ href: '#changelog' }
);
setElementProps(root.querySelector('[data-nav-item="search"]'), {
value: 'search',
textValue: 'Search documentation',
});
</script>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Import the prototypes directly from @proto.ui/prototypes-brutalist/navigation-menu and adapt them for your target runtime:
import { navigationMenuRoot, navigationMenuTrigger, navigationMenuContent, navigationMenuItem, navigationMenuLink,} from '@proto.ui/prototypes-brutalist/navigation-menu';import { BrutalistNavigationMenuRoot, BrutalistNavigationMenuTrigger, BrutalistNavigationMenuContent, BrutalistNavigationMenuItem, BrutalistNavigationMenuLink,} from '../proto-ui/components/react';
export function BrutalistSiteNav() { return ( <BrutalistNavigationMenuRoot a11yLabel="Main navigation"> <BrutalistNavigationMenuTrigger value="getting-started"> Getting started </BrutalistNavigationMenuTrigger> <BrutalistNavigationMenuContent value="getting-started" a11yLabel="Getting started"> <BrutalistNavigationMenuLink href="/docs" current> Introduction </BrutalistNavigationMenuLink> <BrutalistNavigationMenuItem value="copy-theme" textValue="Copy theme CSS"> Copy theme CSS </BrutalistNavigationMenuItem> </BrutalistNavigationMenuContent> </BrutalistNavigationMenuRoot> );}Composition
Section titled “Composition”NavigationMenuRoot (navigation)├── NavigationMenuTrigger (button, paired by value)└── NavigationMenuContent (region, paired by value) ├── NavigationMenuLink (native <a>) └── NavigationMenuItem (command action)Native Links & Keyboard
Section titled “Native Links & Keyboard”- Native browser semantics: URL previews,
Enteractivation, and modifier/middle-click tab opening are handled natively by the browser. React, Vue, and Vue 2 render a native<a>root; Web Components wrap children in an owned anchor element. - Read-only
navigateevent: After native activation,Linkemits a read-onlynavigateevent with{ href, target, rel, modified }. - Dismissal & disabled links: Ordinary same-window activations close the open panel unless
closeOnSelect={false}; modified clicks, middle-clicks, and_blanktargets keep the panel open. Disabled links removehrefand block activation. - Keyboard roving: Arrow keys move across top-level triggers,
ArrowDown/ArrowUpenter the panel at the first or last entry, andEscapecloses the panel and returns focus to the trigger.
Examples
Section titled “Examples”With Icon
Section titled “With Icon”Combine icons and labels inside a Brutalist floating panel with high-contrast hover borders and fills.
<brutalist-navigation-menu-root id="brutalist-nav-icons">
<brutalist-navigation-menu-trigger data-value="status">
With Icon ▾
</brutalist-navigation-menu-trigger>
<brutalist-navigation-menu-content data-value="status">
<brutalist-navigation-menu-link data-href="#backlog">
<span aria-hidden="true">○</span>
Backlog
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-link
data-href="#todo"
data-current="true"
>
<span aria-hidden="true">◔</span>
To Do
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-link data-href="#done">
<span aria-hidden="true">●</span>
Done
</brutalist-navigation-menu-link>
</brutalist-navigation-menu-content>
</brutalist-navigation-menu-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#brutalist-nav-icons');
setElementProps(root, { a11yLabel: 'Project status navigation' });
root.querySelectorAll('[data-value]').forEach((el) => {
setElementProps(el, { value: el.getAttribute('data-value') });
});
root.querySelectorAll('[data-href]').forEach((el) => {
setElementProps(el, {
href: el.getAttribute('data-href'),
current: el.getAttribute('data-current') === 'true',
});
});
</script>Links, Current Page & Disabled
Section titled “Links, Current Page & Disabled”Demonstrates current-page highlighting (current), persistent panels (closeOnSelect={false}), _blank navigation, and disabled triggers or links.
<brutalist-navigation-menu-root id="brutalist-nav-states">
<brutalist-navigation-menu-trigger id="brutalist-guides-trigger">
Guides ▾
</brutalist-navigation-menu-trigger>
<brutalist-navigation-menu-content id="brutalist-guides-content">
<brutalist-navigation-menu-link id="brutalist-link-current">
Overview (current page)
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-link id="brutalist-link-keep-open">
Stay open on click
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-link id="brutalist-link-blank">
Open in new tab ↗
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-link id="brutalist-link-disabled">
Archived guide (disabled)
</brutalist-navigation-menu-link>
</brutalist-navigation-menu-content>
<brutalist-navigation-menu-trigger
id="brutalist-disabled-trigger"
>
Enterprise (disabled)
</brutalist-navigation-menu-trigger>
</brutalist-navigation-menu-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(document.querySelector('#brutalist-nav-states'), {
a11yLabel: 'Documentation link states',
});
setElementProps(
document.querySelector('#brutalist-guides-trigger'),
{ value: 'guides' }
);
setElementProps(
document.querySelector('#brutalist-guides-content'),
{ value: 'guides', a11yLabel: 'Guide links' }
);
setElementProps(
document.querySelector('#brutalist-link-current'),
{ href: '#overview', current: true }
);
setElementProps(
document.querySelector('#brutalist-link-keep-open'),
{ href: '#api-reference', closeOnSelect: false }
);
setElementProps(document.querySelector('#brutalist-link-blank'), {
href: '#release-notes',
target: '_blank',
});
setElementProps(
document.querySelector('#brutalist-link-disabled'),
{ href: '#archived', disabled: true }
);
setElementProps(
document.querySelector('#brutalist-disabled-trigger'),
{ value: 'billing', disabled: true }
);
</script>Controlled & Events
Section titled “Controlled & Events”Drive the active panel with value and valueChange while observing Item.select and Link.navigate.
<brutalist-navigation-menu-root id="brutalist-nav-controlled">
<brutalist-navigation-menu-trigger data-value="docs">
Docs ▾
</brutalist-navigation-menu-trigger>
<brutalist-navigation-menu-content data-value="docs">
<brutalist-navigation-menu-link id="brutalist-ctrl-intro">
Getting started
</brutalist-navigation-menu-link>
<brutalist-navigation-menu-item id="brutalist-ctrl-copy">
Copy install command
</brutalist-navigation-menu-item>
</brutalist-navigation-menu-content>
</brutalist-navigation-menu-root>
<p id="brutalist-ctrl-status" aria-live="polite">
Active panel: none
</p>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#brutalist-nav-controlled');
const status = document.querySelector('#brutalist-ctrl-status');
setElementProps(root, {
value: '',
a11yLabel: 'Controlled navigation',
});
root.querySelectorAll('[data-value]').forEach((el) => {
setElementProps(el, { value: el.getAttribute('data-value') });
});
setElementProps(document.querySelector('#brutalist-ctrl-intro'), {
href: '#getting-started',
current: true,
});
setElementProps(document.querySelector('#brutalist-ctrl-copy'), {
value: 'copy-install',
textValue: 'Copy install command',
});
root.addEventListener('valueChange', (event) => {
const next = event.detail.value;
setElementProps(root, { value: next });
status.textContent = next
? 'Active panel: ' + next
: 'Active panel: none';
});
</script>NavigationMenuRoot
Section titled “NavigationMenuRoot”| Prop / Expose | Type | Default |
|---|---|---|
value | string | undefined (uncontrolled) |
defaultValue | string | '' |
disabled | boolean | false |
loop | boolean | true |
a11yLabel | string | '' |
valueChange (event) | { value: string; reason: string } | — |
requestValue (method) | (value: string, reason?: string) => boolean | — |
close (method) | () => void | — |
NavigationMenuTrigger
Section titled “NavigationMenuTrigger”| Prop | Type | Default |
|---|---|---|
value | string | '' |
disabled | boolean | false |
NavigationMenuContent
Section titled “NavigationMenuContent”| Prop | Type | Default |
|---|---|---|
value | string | '' |
sideOffset | number | 4 |
a11yLabel | string | '' |
NavigationMenuItem
Section titled “NavigationMenuItem”| Prop / Event | Type | Default |
|---|---|---|
value | string | '' |
textValue | string | '' |
disabled | boolean | false |
closeOnSelect | boolean | true |
select (event) | { value: string; menuValue: string } | — |
NavigationMenuLink
Section titled “NavigationMenuLink”| Prop / Event | Type | Default |
|---|---|---|
href | string | '' |
target | '_self' '_blank' | '_self' |
rel | string | '' |
current | boolean | false |
disabled | boolean | false |
closeOnSelect | boolean | true |
navigate (event) | { href: string; target: string; rel: string; modified: boolean } | — |
select (event) | { value: string; menuValue: string } | — |