Skip to content

COMPONENT / mega-menu

Brutal Mega Menu_

Navigation menu trigger that opens a hairline grid of link columns and a hazard-striped promo tile. Built on Base UI. Requires @cybr/tokens and @cybr/effects.

Install

  1. 1. Map the @cybr namespace, once per project. Add this inside your components.json, or into its existing "registries" object. No components.json yet? Run npx shadcn@latest init first to create one.

    "registries": { "@cybr": "https://cybr-ui.com/r/{name}.json" }
  2. 2. Add components:

    $ npx shadcn@latest add @cybr/mega-menu

If shadcn reports Unknown registry "@cybr", step 1 is missing from that project's components.json.

Preview

Props

Component props
PropTypeDefaultDescription
labelReactNode—Trigger text, styled like a Terminal Navbar link, followed by a +/− mark.
columns{ heading: string; links: { label: string; href: string }[] }[]—Link columns in order. The first heading gets a --signal rule, the rest --line.
feature{ eyebrow: string; title: string; href: string }—Optional promo tile in a hazard-stripe frame, placed after the columns.
renderReactElement<div />Root element. Pass <nav aria-label="…" /> to use the menu as its own landmark.
classNamestring—Extra classes on the root, merged after the defaults with cn().
...propsNavigationMenu.Root props—Forwarded to Base UI's NavigationMenu.Root, such as value, onValueChange, delay and closeDelay.

Usage

Installs @base-ui/react. Needs both stylesheets from @cybr/tokens and @cybr/effects. After the install, import them in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
@import "../styles/cybr-effects.css";

Put it inside a TerminalNavbar as children, or inside your own <nav>:

import { MegaMenu } from "@/components/ui/mega-menu";
import { TerminalNavbar } from "@/components/ui/terminal-navbar";

export function SiteNav() {
  return (
    <TerminalNavbar links={[{ label: "DOCS", href: "/docs" }]}>
      <MegaMenu
        label="COMPONENTS"
        columns={[{ heading: "BUTTONS", links: [{ label: "Glitch", href: "/docs/glitch" }] }]}
        feature={{ eyebrow: "NEW DROP", title: "GLITCH BUTTON →", href: "/docs/glitch" }}
      />
    </TerminalNavbar>
  );
}

States

Accessibility