Animated Underline Navbar

About this block

Animated Underline NavbarPRO

Minimal navbar with configurable animated underline effects (slide, grow, or fade) on navigation links. Perfect for portfolio sites and creative agencies wanting subtle hover animations.

Minimal, centered-max-width navbar for portfolios and creative agencies where each nav link carries a configurable hover/active underline animation instead of background highlighting. The active page is driven by an activeNavItem prop rather than route detection.

Upgrade to Pro

Pro blocks install through the shadcn CLI with your license key and ship their full source. Docs and live previews stay open to everyone, so you can read every block's details first.

Upgrade Now

Installation

Swap YOUR_EMAIL and YOUR_KEY for the email and license key on your account. Find your license key on your account page.

Radix flavor

bash
npx shadcn add "https://ui.beste.co/r/navbar31?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

bash
npx shadcn add "https://ui.beste.co/r-base/navbar31?email=YOUR_EMAIL&license_key=YOUR_KEY"

This installs the block to components/beste/block/navbar31.tsx and the shadcn/ui dependency it needs (button).

Quick start

The installed file exports navbar31Demo alongside the block: the exact props behind the preview above. Spread it to get a working navbar in one line.

tsx
import { Navbar31, navbar31Demo } from "@/components/beste/block/navbar31";

export default function Layout() {
  return <Navbar31 {...navbar31Demo} />;
}

Then replace the demo with your own props. Written out, a trimmed setup looks like this:

tsx
import { Navbar31 } from "@/components/beste/block/navbar31";

export default function Layout() {
  return (
    <Navbar31
      logo={{ text: "Studio", href: "/" }}
      navItems={[
        { label: "Home", href: "/" },
        { label: "Work", href: "/work" },
        { label: "Contact", href: "/contact" },
      ]}
      activeNavItem="Home"
      buttons={[{ label: "Sign up", href: "/signup" }]}
      underlineStyle="grow"
    />
  );
}

Props

PropTypeDefaultDescription
logo{ text: string; href?: string }–Brand text and link; falls back to "brand" / # when omitted
navItemsNavItem[][]Nav links rendered in the desktop bar and mobile menu
activeNavItemstring–label of the item to mark as current; controls its underline and text color, caller-managed
buttonsArray<{ label: string; href?: string; variant?: "default" | "outline" | "ghost" }>[]Call-to-action buttons after the nav links
underlineStyle"slide" | "grow" | "fade""slide"Which pseudo-element animation the underline uses on hover/active
classNamestring–Extra classes for the outer <nav>
ts
type NavItem = { label: string; href?: string };

Behavior notes

  • activeNavItem is not derived from the current route; pass the current page's label yourself to keep the underline in sync with navigation.
  • underlineStyle swaps the underline's animation origin/behavior: slide scales in from the left, grow scales in from the center, fade cross-fades opacity. Non-active items animate the same way on hover.
  • In the mobile menu, a button with variant="default" gets rounded-none applied only there; on desktop it keeps the shadcn default rounding.
  • The bar is sticky (sticky top-0 z-50) with a plain bg-background, no border or blur.
  • The mobile breakpoint is lg (1024px); mobile links are listed full-width with a bottom border per row and lighter (font-light) weight.

More Navigation blocks

View all Navigation
PRO

navbar35

Sliding Indicator Navbar

PRO

navbar79

Announcement Navbar

PRO

navbar36

Tab-Style Navbar

Get Pro access