Open this example in the interactive library
Live preview
Source code
// components/CollapsibleNavigationMenu.tsx
export default function CollapsibleNavigationMenu({
links = [
{ label: "Guide", href: "/guide" },
{ label: "About", href: "/about" },
],
}: { links?: { label: string; href: string }[] } = {}) {
return (
<details>
<summary>Menu</summary>
<nav>
{links.map((l) => (
<p key={l.href}>
<a href={l.href}>{l.label}</a>
</p>
))}
</nav>
</details>
);
}
