About
Navigation item that displays a hover-triggered popover menu with rich items containing an icon, title, and optional description. Astryx by Meta. Source: https://astryx.atmeta.com/components/TopNavMenu
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Top Nav Menu to your project and fits it to your theme.
Code
How Astryx Top Nav Menu is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See the MIT notice in astryx-top-nav-menu.tsx. */
import '@/components/ui/astryx-top-nav-menu-utils/astryx-preview.css';
import '@astryxdesign/theme-neutral/fonts.css';
import {useSyncExternalStore} from 'react';
import {Theme} from '@astryxdesign/core/theme';
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
import {
TopNav,
TopNavHeading,
TopNavItem,
TopNavMenu,
} from '@/components/ui/astryx-top-nav-menu';
import {Button} from '@astryxdesign/core/Button';
import {useToast} from '@astryxdesign/core/Toast';
import {
ChartBarIcon as ChartIcon,
Cog6ToothIcon as SettingsIcon,
MagnifyingGlassIcon as SearchIcon,
UsersIcon,
} from '@heroicons/react/24/outline';
function OfficialSample() {
const showToast = useToast();
return (
<TopNav
style={{width: '100%', minWidth: 0}}
label="Menu demo"
heading={<TopNavHeading heading="Platform" />}
startContent={
<>
<TopNavItem label="Home" href="#" isSelected />
<TopNavMenu
label="Tools"
items={[
{
title: 'Analytics',
description: 'View traffic and engagement metrics',
icon: <ChartIcon />,
href: '#analytics',
},
{
title: 'Team Members',
description: 'Manage your team and permissions',
icon: <UsersIcon />,
href: '#team',
},
{
title: 'Settings',
description: 'Configure your workspace',
icon: <SettingsIcon />,
href: '#settings',
},
]}
/>
</>
}
endContent={
<Button
label="Search"
variant="ghost"
icon={<SearchIcon />}
isIconOnly
onClick={() => showToast({body: 'Demo: search would open here'})}
/>
}
/>
);
}
function readPreviewMode() {
const {classList} = document.documentElement;
return classList.contains('dark') ? 'dark' : 'light';
}
function subscribeToPreviewMode(callback: () => void) {
const observer = new MutationObserver(callback);
observer.observe(document.documentElement, {attributes: true, attributeFilter: ['class']});
return () => observer.disconnect();
}
export default function Demo() {
const mode = useSyncExternalStore(subscribeToPreviewMode, readPreviewMode, () => 'light' as const);
return (
<Theme theme={neutralTheme} mode={mode}>
<div className="astryx-demo">
<div className="astryx-demo-content" data-centered style={{maxWidth: 600}}>
<OfficialSample />
</div>
</div>
</Theme>
);
}
















