Files
sweet/www/components/NavigationBar.tsx
T
Luca Casonato 660e0f5fef feat: twind plugin (#513)
This adds a first-party twind plugin to use twind for styling.
2022-08-09 21:41:11 +02:00

35 lines
676 B
TypeScript

/** @jsx h */
import { h } from "preact";
export default function NavigationBar(props: { active: string }) {
const items = [
{
name: "Home",
href: "/",
},
{
name: "Docs",
href: "/docs",
},
];
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>
);
}