All Taste components
Navbar
Navbar — floating pill
A rounded, slightly see-through bar that floats over the top of the hero instead of spanning the page.
pill shape · frosted background · centered links · rounded button · over a tinted hero
"use client";
import { useState } from "react";
import { Menu, X } from "lucide-react";
import { cn } from "@/lib/utils";
const links = [
{ label: "Features", href: "#features" },
{ label: "Pricing", href: "#pricing" },
{ label: "Stories", href: "/stories" },
{ label: "Help", href: "/help" },
];
/** Place this inside your hero (position: relative) or make it sticky at top-4. */
export function NavbarFloatingPill() {
const [open, setOpen] = useState(false);
return (
<header className="sticky top-4 z-40 mx-auto w-[calc(100%-1.5rem)] max-w-3xl font-sans">
<div className="flex h-14 items-center gap-4 rounded-full border border-border bg-bg/80 pl-4 pr-2 shadow-lg backdrop-blur-md">
<a href="/" className="flex items-center gap-2 text-base font-semibold tracking-tight text-fg">
<span aria-hidden className="size-6 rounded-sm bg-primary" />
Slotwise
</a>
<nav aria-label="Main" className="mx-auto hidden sm:block">
<ul className="flex gap-0.5">
{links.map((l) => (
<li key={l.href}>
<a href={l.href} className="inline-flex h-9 items-center rounded-full px-3 text-sm text-fg-muted transition hover:bg-surface hover:text-fg">{l.label}</a>
</li>
))}
</ul>
</nav>
<div className="ml-auto flex items-center gap-1.5 sm:ml-0">
<a href="/signup" className="inline-flex h-9 items-center rounded-full bg-primary px-4 text-sm font-medium text-primary-fg transition hover:bg-primary-hover">Get started</a>
<button
type="button"
aria-label={open ? "Close menu" : "Open menu"}
aria-expanded={open}
onClick={() => setOpen(!open)}
className="inline-grid size-9 place-items-center rounded-full text-fg hover:bg-surface-2 sm:hidden"
>
{open ? <X className="size-4" /> : <Menu className="size-4" />}
</button>
</div>
</div>
<nav aria-label="Mobile" className={cn("mt-2 rounded-xl border border-border bg-bg p-2 shadow-lg sm:hidden", !open && "hidden")}>
{links.map((l) => (
<a key={l.href} href={l.href} className="block rounded px-3 py-2.5 text-[15px] text-fg hover:bg-surface">{l.label}</a>
))}
</nav>
</header>
);
}
The code uses the Taste Tailwind preset. Make yours on the Taste page with Export my system.