Long labels within an application panel
A vertical navigation keeps long labels readable and positions its flyout within the supplied application panel. Click and touch use the same triggers.
Keyboard
- Tab reaches each available link or trigger; disabled links are skipped.
- Use Enter or Space to open the administration links without relying on hover.
- Escape closes and leaves focus on the trigger.
States covered
- Vertical navigation
- Custom collision boundary and portal container
- Long labels at mobile widths
- Disabled links
- Current page
Install this complete example and its component dependencies.
npx shadcn@latest add https://ui.bld8.dev/r/example-navigation-boundary.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 { useState } from 'react';
import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuPopup } from '@bld8/ui/navigation-menu';
export function BoundedNavigationExample() {
const [boundary, setBoundary] = useState<HTMLDivElement | null>(null);
return <div style={{ width: '100%', display: 'grid', gap: 16 }}>
<div ref={setBoundary} style={{ position: 'relative', minHeight: 380, padding: 12, border: '1px solid var(--bui-line)', borderRadius: 8 }}>
<NavigationMenu aria-label="Application panel navigation" orientation="vertical" style={{ width: 260, maxWidth: '100%' }}>
<NavigationMenuList>
<NavigationMenuItem><NavigationMenuLink href="#nav-boundary-overview" active>Organisation overview</NavigationMenuLink></NavigationMenuItem>
<NavigationMenuItem value="administration"><NavigationMenuTrigger>Administration and team permissions</NavigationMenuTrigger><NavigationMenuContent>
<NavigationMenuLink href="#nav-boundary-review" description="Review who can access shared project records.">Team membership and access review</NavigationMenuLink>
<NavigationMenuLink href="#nav-boundary-retention" description="Read the retention policy before exporting records.">Data retention and export settings</NavigationMenuLink>
<NavigationMenuLink disabled href="#nav-boundary-identity" description="Requires an administrator role.">Identity provider configuration</NavigationMenuLink>
</NavigationMenuContent></NavigationMenuItem>
</NavigationMenuList>
<NavigationMenuPopup minWidth={300} portalContainer={boundary} collisionBoundary={boundary ?? undefined} collisionPadding={8} popupProps={{ 'aria-label': 'Administration destinations' }} />
</NavigationMenu>
</div>
<p className="bui-hint" id="nav-boundary-overview">Organisation overview is the current page. Role checks and route access belong to the host application.</p>
<p className="bui-hint" id="nav-boundary-review">Team access review lists the members who can read and edit shared project records.</p>
<p className="bui-hint" id="nav-boundary-retention">Retention settings describe when records expire and which exports are available.</p>
</div>;
}