tsimport {XDSTopNav} from '@xds/core/TopNav'
| Guidance | Practices |
|---|---|
| Do | Include a product logo and name in the heading slot to clearly identify the application. |
| Do | Limit primary navigation items to 5 or fewer for quick scanning and minimal cognitive load. |
| Don't | Avoid using TopNav to filter page content — use Tabs or filter controls instead. |
| Don't | Avoid deeply nested navigation hierarchies — keep menus to one level of depth. |
| Prop | Type | Description |
|---|---|---|
heading | ReactNode | Heading slot content (logo, brand) — positioned at the left edge of the nav bar. |
startContent | ReactNode | Start content slot for navigation items or breadcrumbs — positioned after the heading, left-aligned. |
centerContent | ReactNode | Center content slot (tabs, search bar, primary navigation) — when provided, switches the layout to a three-column CSS grid for true horizontal centering. |
endContent | ReactNode | End content slot for search, icons, or user profile — positioned at the right edge. |
label | string | Accessible label for the navigation landmark, applied as aria-label on the <nav> element. |
xstyle | StyleXStyles | StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}. |
| Prop | Type | Description |
|---|---|---|
heading | string | Heading text to display. |
logo | ReactNode | Logo element to display before the heading text. Can be an image, XDSNavIcon, or any ReactNode. |
href | string | URL to navigate to when clicked. When provided, renders as an anchor element. |
| Prop | Type | Description |
|---|---|---|
labelrequired | string | Accessible label for the nav item. Rendered as visible text by default. When isIconOnly is true, used as aria-label instead. |
href | string | Navigation target URL. |
isSelected | boolean (default: false) | Whether this nav item is currently selected. Sets aria-current="page" and applies highlighted styles. |
isDisabled | boolean (default: false) | Whether the nav item is disabled. Sets aria-disabled and prevents interaction. |
isIconOnly | boolean (default: false) | Renders the item as a square icon-only element. When true, label becomes the aria-label and visible text is hidden. Requires icon to be set. |
icon | ReactNode | Optional icon to display before the label. |
children | ReactNode | Custom content to render instead of the label text. |
as | XDSLinkComponentType | Custom component to render instead of <a>. Overrides the provider-level default set by XDSLinkProvider. Must accept href, className, style, and children props. |
| Prop | Type | Description |
|---|---|---|
labelrequired | string | Visible label for the trigger button. |
items | ReactNode | Menu items slot — typically XDSTopNavMegaMenuItem components, but accepts any ReactNode. |
featured | ReactNode | Featured content slot — rendered in the right panel on desktop, below items in the mobile drawer. |
delay | number (default: 150) | Delay in milliseconds before showing the menu on hover. |
hideDelay | number (default: 250) | Delay in milliseconds before hiding the menu after the mouse leaves. |
onOpenChange | (isOpen: boolean) => void | Callback fired when the mega menu opens or closes. Useful for coordinating wrapper styles. |
| Prop | Type | Description |
|---|---|---|
titlerequired | string | Card title. |
description | string | Description text below the title. |
image | string | Optional image URL displayed above the body. |
imageAlt | string | Alt text for the image. |
linkLabel | string | CTA link text. |
linkHref | string | CTA link URL. |
children | ReactNode | Custom content rendered below the standard body. |
| Prop | Type | Description |
|---|---|---|
titlerequired | string | Display title for the menu item. |
description | string | Optional description text displayed below the title. |
icon | ReactNode | Optional icon element displayed to the left. |
href | string | URL to navigate to when clicked. |
onClick | () => void | Callback when item is clicked. |
as | XDSLinkComponentType | Custom component to render instead of <a> for link items. Overrides the provider-level default set by XDSLinkProvider. |
| Prop | Type | Description |
|---|---|---|
labelrequired | string | Visible label for the trigger button. |
itemsrequired | XDSTopNavMenuItemData[] | Menu items to display in the hover popover. |
delay | number (default: 150) | Delay in milliseconds before showing the menu on hover. |
hideDelay | number (default: 200) | Delay in milliseconds before hiding the menu after the mouse leaves. |
tsx'use client';import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';import {XDSNavIcon} from '@xds/core/NavIcon';import {XDSButton} from '@xds/core/Button';import {XDSIcon} from '@xds/core/Icon';function CubeIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" /><path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" /></svg>);}function UserIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /></svg>);}export default function TopNavCenteredNavigation() {return (<XDSTopNavlabel="Main navigation"heading={<XDSTopNavHeadingheading="My App"logo={<XDSNavIcon icon={<CubeIcon />} />}href="#"/>}centerContent={<><XDSTopNavItem label="Home" href="#" isSelected /><XDSTopNavItem label="Products" href="#" /><XDSTopNavItem label="About" href="#" /></>}endContent={<><XDSButtonlabel="Search"variant="ghost"icon={<XDSIcon icon="search" color="inherit" />}isIconOnly/><XDSButtonlabel="Profile"variant="ghost"icon={<UserIcon />}isIconOnly/></>}/>);}
tsx'use client';import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';import {XDSNavIcon} from '@xds/core/NavIcon';import {XDSButton} from '@xds/core/Button';import {XDSIcon} from '@xds/core/Icon';function ChartIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" /></svg>);}function HomeIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="m2.25 12 8.955-8.955a1.126 1.126 0 0 1 1.59 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" /></svg>);}function DocumentIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" /></svg>);}function CogIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.646.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.333.183-.582.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z" /><path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /></svg>);}function BellIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" /></svg>);}export default function TopNavEnterpriseDashboard() {return (<XDSTopNavlabel="Main navigation"heading={<XDSTopNavHeadingheading="Enterprise Dashboard"logo={<XDSNavIcon icon={<ChartIcon />} />}href="#"/>}startContent={<><XDSTopNavItemlabel="Dashboard"href="#"isSelectedicon={<HomeIcon />}/><XDSTopNavItemlabel="Reports"href="#"icon={<DocumentIcon />}/><XDSTopNavItemlabel="Analytics"href="#"icon={<ChartIcon />}/><XDSTopNavItemlabel="Settings"href="#"icon={<CogIcon />}/></>}endContent={<><XDSButtonlabel="Search"variant="ghost"icon={<XDSIcon icon="search" color="inherit" />}isIconOnly/><XDSButtonlabel="Notifications"variant="ghost"icon={<BellIcon />}isIconOnly/><XDSButton label="Upgrade" variant="primary" /></>}/>);}
tsx'use client';import {XDSTopNav,XDSTopNavHeading,XDSTopNavItem,XDSTopNavMenu,} from '@xds/core/TopNav';import {XDSNavIcon} from '@xds/core/NavIcon';import {XDSButton} from '@xds/core/Button';function CubeIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" /><path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" /></svg>);}function ChartIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" /></svg>);}function ShieldIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z" /></svg>);}function BoltIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z" /></svg>);}function CodeIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" /></svg>);}function UserIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /></svg>);}export default function TopNavHoverMenu() {return (<XDSTopNavlabel="Main navigation"heading={<XDSTopNavHeadingheading="My App"logo={<XDSNavIcon icon={<CubeIcon />} />}href="#"/>}startContent={<><XDSTopNavItem label="Home" href="#" isSelected /><XDSTopNavMenulabel="Products"items={[{title: 'Analytics',description: 'Track and analyze user behavior',icon: <ChartIcon />,href: '#analytics',},{title: 'Security',description: 'Enterprise-grade protection',icon: <ShieldIcon />,href: '#security',},{title: 'Automation',description: 'Streamline your workflows',icon: <BoltIcon />,href: '#automation',},{title: 'Developer Tools',description: 'APIs, SDKs, and CLI tools',icon: <CodeIcon />,href: '#dev-tools',},]}/><XDSTopNavItem label="Pricing" href="#" /></>}endContent={<XDSButtonlabel="Profile"variant="ghost"icon={<UserIcon />}isIconOnly/>}/>);}
tsx'use client';import {XDSTopNav,XDSTopNavHeading,XDSTopNavItem,XDSTopNavMegaMenu,XDSTopNavMegaMenuItem,XDSTopNavMegaMenuFeaturedCard,} from '@xds/core/TopNav';import {XDSNavIcon} from '@xds/core/NavIcon';import {XDSButton} from '@xds/core/Button';function CubeIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" /><path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" /></svg>);}function ChartIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" /></svg>);}function ShieldIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z" /></svg>);}function BoltIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z" /></svg>);}function CodeIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" /></svg>);}function GlobeIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418" /></svg>);}export default function TopNavMegaMenu() {return (<XDSTopNavlabel="Marketing navigation"heading={<XDSTopNavHeadingheading="Acme"logo={<XDSNavIcon icon={<CubeIcon />} />}href="#"/>}startContent={<><XDSTopNavMegaMenulabel="Products"items={<><XDSTopNavMegaMenuItemtitle="Analytics"description="Track and analyze user behavior across your apps"icon={<ChartIcon />}href="#analytics"/><XDSTopNavMegaMenuItemtitle="Security"description="Enterprise-grade protection for your data"icon={<ShieldIcon />}href="#security"/><XDSTopNavMegaMenuItemtitle="Automation"description="Streamline workflows with intelligent tools"icon={<BoltIcon />}href="#automation"/><XDSTopNavMegaMenuItemtitle="Developer Tools"description="APIs, SDKs, and CLI for integration"icon={<CodeIcon />}href="#dev-tools"/><XDSTopNavMegaMenuItemtitle="Global Network"description="Low-latency edge infra in 40+ regions"icon={<GlobeIcon />}href="#network"/></>}featured={<XDSTopNavMegaMenuFeaturedCardtitle="What's new in v4.0"description="AI-powered analytics and real-time collaboration."image="https://lookaside.facebook.com/assets/xds_oss/light-working-horizontal-1.png"imageAlt="Team collaboration"linkLabel="Read the announcement"linkHref="#announcement"/>}/><XDSTopNavItem label="Pricing" href="#" /><XDSTopNavItem label="Docs" href="#" /></>}endContent={<><XDSButton label="Sign in" variant="ghost" /><XDSButton label="Get started" variant="primary" /></>}/>);}
tsx'use client';import {XDSTopNav,XDSTopNavHeading,XDSTopNavItem,XDSTopNavMenu,} from '@xds/core/TopNav';function ChartIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z" /></svg>);}function ShieldIcon() {return (<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z" /></svg>);}export default function TopNavMultipleDropdowns() {return (<XDSTopNavlabel="Main navigation"heading={<XDSTopNavHeading heading="Platform" href="#" />}startContent={<><XDSTopNavMenulabel="Products"items={[{title: 'Analytics',description: 'Track behavior',icon: <ChartIcon />,href: '#',},{title: 'Security',description: 'Enterprise protection',icon: <ShieldIcon />,href: '#',},]}/><XDSTopNavMenulabel="Resources"items={[{title: 'Documentation', href: '#'},{title: 'API Reference', href: '#'},{title: 'Community Forum', href: '#'},]}/><XDSTopNavItem label="Pricing" href="#" /></>}/>);}
tsx'use client';import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';import {XDSNavIcon} from '@xds/core/NavIcon';import {XDSButton} from '@xds/core/Button';function CubeIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M21 16.5V7.914a1.5 1.5 0 0 0-.75-1.299l-7.5-4.329a1.5 1.5 0 0 0-1.5 0l-7.5 4.33A1.5 1.5 0 0 0 3 7.913V16.5a1.5 1.5 0 0 0 .75 1.3l7.5 4.328a1.5 1.5 0 0 0 1.5 0l7.5-4.329A1.5 1.5 0 0 0 21 16.5Z" /><path strokeLinecap="round" strokeLinejoin="round" d="m3.75 7.5 8.25 4.764 8.25-4.764M12 22.089V12.264" /></svg>);}function UserIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /></svg>);}export default function TopNavWithLogo() {return (<XDSTopNavlabel="Main navigation"heading={<XDSTopNavHeadingheading="Dashboard"logo={<XDSNavIcon icon={<CubeIcon />} />}href="#"/>}startContent={<><XDSTopNavItem label="Overview" href="#" isSelected /><XDSTopNavItem label="Analytics" href="#" /><XDSTopNavItem label="Reports" href="#" /></>}endContent={<XDSButtonlabel="Profile"variant="ghost"icon={<UserIcon />}isIconOnly/>}/>);}
tsx'use client';import {XDSTopNav, XDSTopNavHeading, XDSTopNavItem} from '@xds/core/TopNav';import {XDSButton} from '@xds/core/Button';import {XDSIcon} from '@xds/core/Icon';function BellIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" /></svg>);}function UserIcon() {return (<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /></svg>);}export default function TopNavShowcase() {return (<XDSTopNavlabel="Main navigation"heading={<XDSTopNavHeading heading="My App" />}startContent={<><XDSTopNavItem label="Home" href="#" isSelected /><XDSTopNavItem label="Products" href="#" /><XDSTopNavItem label="About" href="#" /></>}endContent={<><XDSButtonlabel="Search"variant="ghost"icon={<XDSIcon icon="search" color="inherit" />}isIconOnly/><XDSButtonlabel="Notifications"variant="ghost"icon={<BellIcon />}isIconOnly/><XDSButtonlabel="Profile"variant="ghost"icon={<UserIcon />}isIconOnly/></>}/>);}