Module

x/fresh/www/components/NavigationBar.tsx

The next-gen web framework.
Extremely Popular
Go to Latest
File
export default function NavigationBar(props: { active: string }) { const items = [ { name: "Home", href: "/", }, { name: "Docs", href: "/docs", }, { name: "Showcase", href: "/showcase", }, ];
return ( <nav class="bg-green-200 py-2"> <ul class="flex justify-center gap-8 mx-4"> {items.map((item) => ( <li> <a href={item.href} class={`text-gray-600 hover:underline ${ props.active == item.href ? "font-bold" : "" }`} > {item.name} </a> </li> ))} </ul> </nav> );}