NavigationMenu
Native links and exclusive details disclosures for site navigation.
All components · Theme builder · Implementation source
Live preview
Open live navigation-menu preview
Install
netscript ui:add navigation-menuUsage and examples
The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.
import { useState } from 'preact/hooks';
import { NavigationMenu } from '@app/components/ui/navigation-menu.tsx';
export function Example() {
const [value, setValue] = useState('standard');
const [open, setOpen] = useState(false);
const [notice, report] = useState('');
return (<><div><NavigationMenu label="Order navigation" items={[{id:"orders",label:"Orders",href:"#orders"}]} /></div><p role="status">{notice}</p></>);
}Props
Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.
| Owner | Prop | Type | Optional | Description |
|---|---|---|---|---|
NavigationMenuProps | label | string | No | |
NavigationMenuProps | items | [object Object] | No | |
NavigationMenuProps | class | string | Yes |
NavigationMenuProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "class">Keyboard
| Key | Action |
|---|---|
Enter/Space | Toggle disclosure |
Escape | Close disclosure and return focus to its summary. |
Tab/Shift+Tab | Follow native link/summary order; focus exit closes disclosure. |
Tokens
Semantic contract roles: radius/control, text/fg, text/muted.
CSS custom properties referenced directly: --ns-border, --ns-border-width, --ns-card, --ns-control-gap, --ns-control-height-sm, --ns-control-padding-x, --ns-fg, --ns-hover, --ns-muted-fg, --ns-radius-card, --ns-radius-control, --ns-ring, --ns-shadow-md, --ns-space-1, --ns-space-16, --ns-space-2, --ns-text-body, --ns-text-small, --ns-text-strong, --ns-weight-strong, --ns-z-dropdown.
Contract and compatibility
Accessibility pattern: WAI-ARIA guidance
- Native details/name exclusivity works before hydration; island adds Escape and focus-exit dismissal. Open/trigger/state are derived from the native disclosure and item records.
- Current links, including disclosure-panel links, own aria-current=page; their decorative marker has no tab stop. Escape is handled only while a disclosure is open, preserving outer native dismissal.
Design contract values marked planned are not implementation props. The props above describe what ships today.