Skip to content
Ballpoint

Navigation Menu

A site's main links, some of which open a panel of more. One slip of paper that resizes and slides between the items.

From shadcn/ui
Built on Base UI Navigation Menu

Installation

pnpm dlx shadcn@latest add @ballpoint/navigation-menu

Usage

tsx
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger } from "@/components/ui/navigation-menu"

<NavigationMenu>
  <NavigationMenuList>
    <NavigationMenuItem>
      <NavigationMenuTrigger>Getting started</NavigationMenuTrigger>
      <NavigationMenuContent>
        <NavigationMenuLink href="/docs">Introduction</NavigationMenuLink>
      </NavigationMenuContent>
    </NavigationMenuItem>
  </NavigationMenuList>
</NavigationMenu>

Examples

A bar of plain links with the current one marked.

API reference

align
default "start"
"start" | "center" | "end"

How the panel lines up with the item it opens from.

NavigationMenuLink render
default <a />
ReactElement

Render the link as your framework's, e.g. render={<Link href="/" />}.

NavigationMenuLink bar
default false
boolean

A link on the bar itself, underlined when pointed at like a trigger. Without it, a link in a panel, shaded in when pointed at.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Navigation Menu.

Pen settings

The drawing also takes draw, roughness, passes, radius, corners, shadow, weight and speed, as props or from the nearest InkProvider. What each one does.