PolyHunter

NavGroup

Sidebar navigation with expanded/collapsed variants out of the box — it reads the surrounding Sidebar state via useSidebar. Collapsed renders a centered icon rail and hides submenus; expanded items carry the chevron submenu: roots with children are not clickable, only their children are. The active leaf gets the role selection surface — accent color follows variant (hunter #FF925A default, guild #A8B7FF). Leaves render as real links; routing reactions live in the onNavigate listener.

Playground

Live preview

Variant — active accent follows the role

Active items take the hunter accent — the Leaderboard leaf and the promoted Guild HQ root (collapsed child-active). Toggle the sidebar to see the collapsed rail.

Examples

Icon cases — guild variant

Guild accent (#A8B7FF) on every active case: parent icon + child icons, parent icon only, parent no icon, leaf with and without icon — collapsed falls back to a centered dot when an item has no icon.

Usage

import { NavGroup, Sidebar } from "@npolyhunter/ui";

// NavGroup reads the Sidebar state — icons only when collapsed,
// submenus hidden. Roots with children are not clickable; the
// chevron toggles the submenu.
<Sidebar>
  <NavGroup
    items={[
      { label: "Missions", icon: <HomeBoldDuotoneIcon />, href: "/missions" },
      {
        label: "Guild HQ",
        icon: <UsersGroupRoundedBoldDuotoneIcon />,
        children: [
          { label: "Overview", href: "/guild" },
          { label: "Members", href: "/guild/members", active: true },
          { label: "Review work", href: "/guild/review", count: 7 },
        ],
      },
    ]}
    // React to navigation — leaves render as real links, this is the hook
    // for routing, closing drawers, tracking, …
    onNavigate={(item) => console.log("navigate", item.href)}
  />
</Sidebar>

Used in

Includes use through shared UI components.

AppBack Office