bloxa

Nav Menu

FREE

Vertical navigation with icons, badges, nested collapsible groups and a highlight that glides to the active page.

Installation

Terminal
npx @bloxa/cli add nav-menu
# or: npx shadcn@latest add @bloxa/nav-menu

Packages installed automatically: motion, radix-ui

Examples

Icons, badges and nested groups

Click an item and the highlight glides to it. This site's docs menu is a NavMenu too.

API reference

Every component also accepts the props of the element it renders.

NavMenu

PropTypeDefaultDescription
currentstring—Current location (e.g. pathname); matching items are active.
matchNestedbooleanfalseTreat nested routes as active.

NavSection

PropTypeDefaultDescription
titleReactNode—Small section heading.

NavItem

PropTypeDefaultDescription
hrefstring—Link.
iconReactNode—Icon on the left.
badgeReactNode—Count or label on the right.
activeboolean—Force the active state.
asChildbooleanfalseRender your router link (e.g. Next Link).

NavGroup

PropTypeDefaultDescription
title / icon / badgeReactNode—Group title, icon and badge.
defaultOpenboolean—Start open; by default a group holding the active item opens itself.