Home / File/ nav-main.tsx — ui Source File

nav-main.tsx — ui Source File

Architecture documentation for nav-main.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry UIPrimitives 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  4bb6147e_7b5f_28a2_9b31_02cbe8fe94a4["nav-main.tsx"]
  ac307fe4_34c0_4667_089c_c9e7c15ca708["dropdown-menu"]
  4bb6147e_7b5f_28a2_9b31_02cbe8fe94a4 --> ac307fe4_34c0_4667_089c_c9e7c15ca708
  f1a5091e_9f4f_a457_6394_4e05eb42bbf1["sidebar"]
  4bb6147e_7b5f_28a2_9b31_02cbe8fe94a4 --> f1a5091e_9f4f_a457_6394_4e05eb42bbf1
  de6fac54_74ca_6c25_8f8b_d1ba3287dbf2["icon-placeholder"]
  4bb6147e_7b5f_28a2_9b31_02cbe8fe94a4 --> de6fac54_74ca_6c25_8f8b_d1ba3287dbf2
  style 4bb6147e_7b5f_28a2_9b31_02cbe8fe94a4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuTrigger,
} from "@/registry/bases/base/ui/dropdown-menu"
import {
  SidebarGroup,
  SidebarMenu,
  SidebarMenuButton,
  SidebarMenuItem,
  useSidebar,
} from "@/registry/bases/base/ui/sidebar"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

export function NavMain({
  items,
}: {
  items: {
    title: string
    url: string
    icon?: React.ReactNode
    isActive?: boolean
    items?: {
      title: string
      url: string
    }[]
  }[]
}) {
  const { isMobile } = useSidebar()
  return (
    <SidebarGroup>
      <SidebarMenu>
        {items.map((item) => (
          <DropdownMenu key={item.title}>
            <SidebarMenuItem>
              <DropdownMenuTrigger
                render={
                  <SidebarMenuButton className="aria-expanded:bg-muted" />
                }
              >
                {item.title}{" "}
                <IconPlaceholder
                  lucide="MoreHorizontalIcon"
                  tabler="IconDots"
                  hugeicons="MoreHorizontalCircle01Icon"
                  phosphor="DotsThreeOutlineIcon"
                  remixicon="RiMoreLine"
                  className="ml-auto"
                />
              </DropdownMenuTrigger>
              {item.items?.length ? (
                <DropdownMenuContent
                  side={isMobile ? "bottom" : "right"}
                  align={isMobile ? "end" : "start"}
                  className="min-w-56 rounded-lg"
                >
                  {item.items.map((item) => (
                    <DropdownMenuItem
                      key={item.title}
                      render={<a href={item.url} />}
                    >
                      {item.title}
                    </DropdownMenuItem>
                  ))}
                </DropdownMenuContent>
              ) : null}
            </SidebarMenuItem>
          </DropdownMenu>
        ))}
      </SidebarMenu>
    </SidebarGroup>
  )
}

Subdomains

Functions

Dependencies

  • dropdown-menu
  • icon-placeholder
  • sidebar

Frequently Asked Questions

What does nav-main.tsx do?
nav-main.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in nav-main.tsx?
nav-main.tsx defines 1 function(s): NavMain.
What does nav-main.tsx depend on?
nav-main.tsx imports 3 module(s): dropdown-menu, icon-placeholder, sidebar.
Where is nav-main.tsx in the architecture?
nav-main.tsx is located at apps/v4/registry/bases/base/blocks/sidebar-06/components/nav-main.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: apps/v4/registry/bases/base/blocks/sidebar-06/components).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free