nav-secondary.tsx — ui Source File
Architecture documentation for nav-secondary.tsx, a tsx file in the ui codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR bab4319b_fe35_9764_c308_a2adaea80c3f["nav-secondary.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] bab4319b_fe35_9764_c308_a2adaea80c3f --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 39a0d62e_8e7d_d097_eb95_91d2bca361f7["icons-react"] bab4319b_fe35_9764_c308_a2adaea80c3f --> 39a0d62e_8e7d_d097_eb95_91d2bca361f7 75d25ec8_fe84_91a4_54c6_20dabb286f91["next-themes"] bab4319b_fe35_9764_c308_a2adaea80c3f --> 75d25ec8_fe84_91a4_54c6_20dabb286f91 12632a83_ef01_5f03_4110_ed33d49893b7["sidebar"] bab4319b_fe35_9764_c308_a2adaea80c3f --> 12632a83_ef01_5f03_4110_ed33d49893b7 334339cf_a0db_b417_9d88_14840f1e3173["skeleton"] bab4319b_fe35_9764_c308_a2adaea80c3f --> 334339cf_a0db_b417_9d88_14840f1e3173 38ebb3c2_9638_6c9d_8ced_a16ec1ff06c9["switch"] bab4319b_fe35_9764_c308_a2adaea80c3f --> 38ebb3c2_9638_6c9d_8ced_a16ec1ff06c9 style bab4319b_fe35_9764_c308_a2adaea80c3f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { IconBrightness, type Icon } from "@tabler/icons-react"
import { useTheme } from "next-themes"
import {
SidebarGroup,
SidebarGroupContent,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "@/registry/new-york-v4/ui/sidebar"
import { Skeleton } from "@/registry/new-york-v4/ui/skeleton"
import { Switch } from "@/registry/new-york-v4/ui/switch"
export function NavSecondary({
items,
...props
}: {
items: {
title: string
url: string
icon: Icon
}[]
} & React.ComponentPropsWithoutRef<typeof SidebarGroup>) {
const { resolvedTheme, setTheme } = useTheme()
const [mounted, setMounted] = React.useState(false)
React.useEffect(() => {
setMounted(true)
}, [])
return (
<SidebarGroup {...props}>
<SidebarGroupContent>
<SidebarMenu>
{items.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton asChild>
<a href={item.url}>
<item.icon />
<span>{item.title}</span>
</a>
</SidebarMenuButton>
</SidebarMenuItem>
))}
<SidebarMenuItem className="group-data-[collapsible=icon]:hidden">
<SidebarMenuButton asChild>
<label>
<IconBrightness />
<span>Dark Mode</span>
{mounted ? (
<Switch
className="ml-auto"
checked={resolvedTheme !== "light"}
onCheckedChange={() =>
setTheme(resolvedTheme === "dark" ? "light" : "dark")
}
/>
) : (
<Skeleton className="ml-auto h-4 w-8 rounded-full" />
)}
</label>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
)
}
Domain
Subdomains
Functions
Dependencies
- icons-react
- next-themes
- react
- sidebar
- skeleton
- switch
Source
Frequently Asked Questions
What does nav-secondary.tsx do?
nav-secondary.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-secondary.tsx?
nav-secondary.tsx defines 1 function(s): NavSecondary.
What does nav-secondary.tsx depend on?
nav-secondary.tsx imports 6 module(s): icons-react, next-themes, react, sidebar, skeleton, switch.
Where is nav-secondary.tsx in the architecture?
nav-secondary.tsx is located at apps/v4/app/(examples)/dashboard/components/nav-secondary.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/app/(examples)/dashboard/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free