Detached Pill Mega

About this block

Detached Pill MegaPRO

A floating rounded pill set off the top edge with the brand, four links and a small button. The Features item opens a floating card under the pill with two columns of links and descriptions. On a phone the pill itself grows into a card with a height animation that holds the menu. Every panel stays in the markup and is toggled with CSS or a height animation.

A floating pill bar set off the top edge, holding the brand, four links and a small button. The Features item opens a floating card under the pill with two columns of described links; on a phone the pill itself grows into a card with a height animation and the menu inside it.

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://beste.dev/r/navbar88?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

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

This installs the block to components/beste/block/navbar88.tsx plus the shadcn button primitive it uses, and adds framer-motion for the mobile height animation.

Quick start

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

tsx
import { Navbar88, navbar88Demo } from "@/components/beste/block/navbar88";

export default function Page() {
  return <Navbar88 {...navbar88Demo} />;
}

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

tsx
import { Navbar88 } from "@/components/beste/block/navbar88";

export default function Page() {
  return (
    <Navbar88
      brand="Alder"
      mega={{
        label: "Features",
        columns: [
          {
            title: "Write",
            links: [
              { title: "Editor", description: "A calm page with markdown shortcuts.", href: "/editor" },
              { title: "Templates", description: "Start from ready layouts.", href: "/templates" },
            ],
          },
          {
            title: "Share",
            links: [{ title: "Publishing", description: "One click to a public page.", href: "/publishing" }],
          },
        ],
      }}
      links={[
        { label: "Pricing", href: "/pricing" },
        { label: "Docs", href: "/docs" },
      ]}
      button={{ label: "Sign up", href: "/signup" }}
      labels={{ open: "Open menu", close: "Close menu" }}
    />
  );
}

Props

PropTypeDefaultDescription
brandstring–Wordmark at the start of the pill
megaMega–The item that opens the floating features card
linksNavItem[][]Plain links beside it
buttonActionButton–Small rounded button at the end of the pill, repeated in the mobile card
labels{ open?: string; close?: string }{}Accessible names for the mobile toggle
classNamestring–Extra classes for the outer <header>
ts
type Mega = {
  label: string;
  columns: FeatureColumn[];
};

type FeatureColumn = {
  title: string;
  links: FeatureLink[];
};

type FeatureLink = {
  title: string;
  description: string;
  href: string;
};

type NavItem = {
  label: string;
  href: string;
};

type ActionButton = {
  label: string;
  href: string;
  variant?: "default" | "outline" | "ghost" | "secondary";
};

Behavior notes

  • The features card is always rendered and toggled with CSS classes, and the mobile menu stays mounted at zero height, so every link is in the server-rendered HTML. Both carry aria-hidden and inert while closed, which keeps their links out of the tab order.
  • The Features trigger opens on hover and on click, with aria-expanded and aria-controls; the card closes when the pointer leaves the header, when a plain link is hovered, on Escape and on a pointer down outside the header.
  • The card hangs from a padded wrapper flush with the pill, so the pointer can cross the gap without closing it.
  • On a phone the pill switches from rounded-full to rounded-md and framer-motion animates its menu from height 0 to auto; reduced motion makes the change instant. Escape, a tap outside and any link inside close it.
  • The sticky header itself ignores pointer events, so the page stays clickable around the floating pill.

More Navigation blocks

View all Navigation
PRO

navbar113

Pricing Preview Mega

PRO

navbar61

Use-Case Mega Navbar

PRO

navbar100

Bordered Cells Mega

Get Pro