Grouped documentation directory
Two columns organise installation and reference links, then collapse into a single readable column on narrow screens.
Keyboard
- Open Documentation with Enter or Arrow Down.
- Tab moves through links in document order; each group keeps its visible heading.
- Escape dismisses without changing the current-page marker.
States covered
- Labelled link groups
- Responsive two-column layout
- Current documentation page
- Long descriptions
Install this complete example and its component dependencies.
npx shadcn@latest add https://ui.bld8.dev/r/example-navigation-documentation.jsonComplete source
/*!
MIT License
Copyright (c) 2026 Jaison
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use client';
import '@bld8/ui/styles.css';
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuGroup, NavigationMenuPopup } from '@bld8/ui/navigation-menu';
export function DocumentationNavigationExample() {
return <div style={{ width: '100%', display: 'grid', gap: 24 }}>
<NavigationMenu aria-label="Documentation directory">
<NavigationMenuList>
<NavigationMenuItem value="docs"><NavigationMenuTrigger>Documentation</NavigationMenuTrigger><NavigationMenuContent>
<div className="bui-navigation-columns">
<NavigationMenuGroup label="Start building">
<NavigationMenuLink href="#nav-docs-install" active description="Install editable source and preserve its notices.">Installation</NavigationMenuLink>
<NavigationMenuLink href="#nav-docs-theme" description="Set shared colour, type and spacing tokens.">Theme setup</NavigationMenuLink>
<NavigationMenuLink href="#nav-docs-keyboard" description="Review keyboard paths and focus ownership.">Keyboard guide</NavigationMenuLink>
</NavigationMenuGroup>
<NavigationMenuGroup label="Reference">
<NavigationMenuLink href="#nav-docs-api" description="Read public properties and controlled state contracts.">Component APIs</NavigationMenuLink>
<NavigationMenuLink href="#nav-docs-versions" description="Track source changes before updating a local copy.">Source versions</NavigationMenuLink>
</NavigationMenuGroup>
</div>
</NavigationMenuContent></NavigationMenuItem>
<NavigationMenuItem value="help"><NavigationMenuTrigger>Help</NavigationMenuTrigger><NavigationMenuContent>
<NavigationMenuLink href="#nav-docs-keyboard" description="Find the interaction used by each control.">Interaction reference</NavigationMenuLink>
</NavigationMenuContent></NavigationMenuItem>
</NavigationMenuList>
<NavigationMenuPopup minWidth={280} popupProps={{ 'aria-label': 'Documentation links' }} />
</NavigationMenu>
<div className="bui-hint" style={{ display: 'grid', gap: 12 }}>
<p id="nav-docs-install"><strong>Installation:</strong> add the source module, its runtime dependencies and shared CSS.</p>
<p id="nav-docs-theme"><strong>Theme setup:</strong> use the same CSS tokens for controls and portalled overlays.</p>
<p id="nav-docs-keyboard"><strong>Keyboard guide:</strong> preserve native links, visible focus and Escape dismissal.</p>
<p id="nav-docs-api"><strong>Component APIs:</strong> value and defaultValue identify the open flyout; active identifies a current page link.</p>
<p id="nav-docs-versions"><strong>Source versions:</strong> review changes against your customised copy before replacing source.</p>
</div>
</div>;
}