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

nav-user.tsx — ui Source File

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

File tsx DocumentationAtlas SearchAPI 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  53b70781_fc5c_64a3_8391_06dff43ebc02["nav-user.tsx"]
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  53b70781_fc5c_64a3_8391_06dff43ebc02 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  550576ca_32fe_8288_72d6_10281189833b["avatar"]
  53b70781_fc5c_64a3_8391_06dff43ebc02 --> 550576ca_32fe_8288_72d6_10281189833b
  57e86e45_ac6e_7278_be08_9092724e8401["button"]
  53b70781_fc5c_64a3_8391_06dff43ebc02 --> 57e86e45_ac6e_7278_be08_9092724e8401
  d1cb37f2_0d1d_01bc_0d60_a15219afac51["dropdown-menu"]
  53b70781_fc5c_64a3_8391_06dff43ebc02 --> d1cb37f2_0d1d_01bc_0d60_a15219afac51
  style 53b70781_fc5c_64a3_8391_06dff43ebc02 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { BadgeCheck, Bell, CreditCard, LogOut, Sparkles } from "lucide-react"

import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "@/registry/new-york-v4/ui/avatar"
import { Button } from "@/registry/new-york-v4/ui/button"
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuGroup,
  DropdownMenuItem,
  DropdownMenuLabel,
  DropdownMenuSeparator,
  DropdownMenuTrigger,
} from "@/registry/new-york-v4/ui/dropdown-menu"

export function NavUser({
  user,
}: {
  user: {
    name: string
    email: string
    avatar: string
  }
}) {
  return (
    <DropdownMenu>
      <DropdownMenuTrigger asChild>
        <Button variant="ghost" size="icon">
          <Avatar className="size-8 rounded-md">
            <AvatarImage src={user.avatar} alt={user.name} />
            <AvatarFallback className="rounded-lg">CN</AvatarFallback>
          </Avatar>
        </Button>
      </DropdownMenuTrigger>
      <DropdownMenuContent
        className="w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg"
        side="bottom"
        align="end"
        sideOffset={4}
      >
        <DropdownMenuLabel className="p-0 font-normal">
          <div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
            <Avatar className="h-8 w-8 rounded-lg">
              <AvatarImage src={user.avatar} alt={user.name} />
              <AvatarFallback className="rounded-lg">CN</AvatarFallback>
            </Avatar>
            <div className="grid flex-1 text-left text-sm leading-tight">
              <span className="truncate font-medium">{user.name}</span>
              <span className="text-muted-foreground truncate text-xs">
                {user.email}
              </span>
            </div>
          </div>
        </DropdownMenuLabel>
        <DropdownMenuSeparator />
        <DropdownMenuGroup>
          <DropdownMenuItem>
            <Sparkles />
            Upgrade to Pro
          </DropdownMenuItem>
        </DropdownMenuGroup>
        <DropdownMenuSeparator />
        <DropdownMenuGroup>
          <DropdownMenuItem>
            <BadgeCheck />
            Account
          </DropdownMenuItem>
          <DropdownMenuItem>
            <CreditCard />
            Billing
          </DropdownMenuItem>
          <DropdownMenuItem>
            <Bell />
            Notifications
          </DropdownMenuItem>
        </DropdownMenuGroup>
        <DropdownMenuSeparator />
        <DropdownMenuItem>
          <LogOut />
          Log out
        </DropdownMenuItem>
      </DropdownMenuContent>
    </DropdownMenu>
  )
}

Subdomains

Functions

Dependencies

  • avatar
  • button
  • dropdown-menu
  • lucide-react

Frequently Asked Questions

What does nav-user.tsx do?
nav-user.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, SearchAPI subdomain.
What functions are defined in nav-user.tsx?
nav-user.tsx defines 1 function(s): NavUser.
What does nav-user.tsx depend on?
nav-user.tsx imports 4 module(s): avatar, button, dropdown-menu, lucide-react.
Where is nav-user.tsx in the architecture?
nav-user.tsx is located at apps/v4/app/(examples)/dashboard-03/components/nav-user.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/app/(examples)/dashboard-03/components).

Analyze Your Own Codebase

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

Try Supermodel Free