Navbar Sliding Highlight
A pill glides between links as you hover or tab through them, then settles back on the current page when you leave.
navbarhoverlayout animationpilltabs
Installation
Run the shadcn CLI in a project with Tailwind CSS. The component lands in components/pixelpapa/navbar-sliding-highlight.tsx.
$pnpm dlx shadcn@latest add "https://pixelpapa.com/r/navbar-sliding-highlight.json"Manual install+
1. Install the dependencies.
$pnpm add motion2. Copy the code from the Code tab above into your project. It imports the cn helper from @/lib/utils, which every shadcn project already has.
Build it with AI
Prefer to let an agent do the wiring? Copy this prompt, describe where the component should go, and paste.
AI prompt
Paste into Claude, Cursor, v0 or Lovable
Add the "Navbar Sliding Highlight" component from PixelPapa UI to this project. What it is: A pill glides between links as you hover or tab through them, then settles back on the current page when you leave. Category: Navbars. Depends on: motion. 1. Install it with the shadcn CLI: npx shadcn@latest add "https://pixelpapa.com/r/navbar-sliding-highlight.json" (If the CLI is unavailable, fetch that URL, write files[0].content to components/pixelpapa/navbar-sliding-highlight.tsx and install the listed dependencies.) 2. Import it from "@/components/pixelpapa/navbar-sliding-highlight" and place it where I describe below. 3. Keep its animation timings and accessibility attributes. Replace the demo copy and data with content that fits my product, and use my existing theme tokens (bg-background, text-foreground, bg-primary, border-border) rather than hard-coded colours. Where to use it: <describe the page and position here>
More navbars
- Navbar Announcement BarA navbar topped by a dismissible strip that ticks through announcements and folds away with a spring when closed.
- Navbar Centered LogoAn editorial storefront header with a serif wordmark between two link groups; labels roll on hover and the bag count pops when it changes.
- Navbar Command SearchA docs navbar whose compact search field widens on focus or ⌘K into a filterable result list with arrow-key navigation.
- Navbar Dynamic IslandA compact black pill of links that swells on a spring into a live notification, drains a timer line, then shrinks back to navigation.
- Navbar Floating PillA floating pill navbar that condenses as you scroll: it narrows on a spring, drops its release chip and swaps the CTA label for an arrow.
- Navbar Glass BlurA frosted floating navbar that blurs and saturates whatever scrolls beneath it, with a specular highlight that tracks the pointer along the glass.