Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

NavigationMenu

Native links and exclusive details disclosures for site navigation.

All components · Theme builder · Implementation source

Live preview

Open live navigation-menu preview

Install

Shell
netscript ui:add navigation-menu

Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

TypeScript
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.

OwnerPropTypeOptionalDescription
NavigationMenuPropslabelstringNo
NavigationMenuPropsitems[object Object]No
NavigationMenuPropsclassstringYes
TypeScript
NavigationMenuProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "class">

Keyboard

KeyAction
Enter/SpaceToggle disclosure
EscapeClose disclosure and return focus to its summary.
Tab/Shift+TabFollow 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.

Search all documentation

Type a term to search the documentation.