Floating Pill Navbar
A floating, rounded navigation bar that stays centered at the top of the page.
Installation
npx shadcn@latest add @venusui/navbar-02Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Files added to your project
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/navbar-02.tsx
Usage
The code behind the preview above.
navbar-02-demo.tsx
import { Navbar02 } from "@/components/navbar-02"
export default function Navbar02Demo() {
return <Navbar02 />
}
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| currentHref | string | "#features" | Highlights the matching link. Pass your router’s current path. |
Only the prop above.
Requirements
lucide-react, React 19 and Tailwind CSS v4.
Customization
- In Next.js, pass
currentHref={usePathname()}from a Client Component and use real paths inlinks. - Remove
sticky top-4from the outer element if it shouldn’t follow the page.
Accessibility
- The current link has
aria-current="page". - The menu button exposes
aria-expanded; Escape closes the menu and returns focus.
Troubleshooting
- Content shows through the bar.
- It uses a translucent background with blur. Raise the opacity (
bg-background/95) for busy pages. Unknown registry "@venusui"- Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (
npx shadcn@latest), install by URL, or register it with its address:npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json. No components.json found- Run
npx shadcn@latest initin your project first.