sidebar.tsx — ui Source File
Architecture documentation for sidebar.tsx, a tsx file in the ui codebase. 12 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 0dd28c0a_4131_40f2_8cf0_e0611d33faf6["sidebar.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3 9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 9c463da6_747b_38dc_586b_cbb4873070b1 77b7a4f4_c577_8eb7_1c27_3fd006855618["use-mobile"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 77b7a4f4_c577_8eb7_1c27_3fd006855618 7758fdd8_25c1_a333_03ce_5e171102a1ec["utils"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 7758fdd8_25c1_a333_03ce_5e171102a1ec 57e86e45_ac6e_7278_be08_9092724e8401["button"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 57e86e45_ac6e_7278_be08_9092724e8401 80cf663d_a411_487c_d69e_ac9d405cd2ec["input"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 80cf663d_a411_487c_d69e_ac9d405cd2ec b2c60dee_4ede_8485_a6b4_91c999cdc69f["separator"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> b2c60dee_4ede_8485_a6b4_91c999cdc69f 58ac4ad9_4dcc_824e_b958_15469e530779["sheet"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 58ac4ad9_4dcc_824e_b958_15469e530779 334339cf_a0db_b417_9d88_14840f1e3173["skeleton"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> 334339cf_a0db_b417_9d88_14840f1e3173 a2518e24_160d_3f8f_bb12_2206d8e84ab8["tooltip"] 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 --> a2518e24_160d_3f8f_bb12_2206d8e84ab8 style 0dd28c0a_4131_40f2_8cf0_e0611d33faf6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { PanelLeftIcon } from "lucide-react"
import { Slot } from "radix-ui"
import { useIsMobile } from "@/registry/new-york-v4/hooks/use-mobile"
import { cn } from "@/registry/new-york-v4/lib/utils"
import { Button } from "@/registry/new-york-v4/ui/button"
import { Input } from "@/registry/new-york-v4/ui/input"
import { Separator } from "@/registry/new-york-v4/ui/separator"
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
} from "@/registry/new-york-v4/ui/sheet"
import { Skeleton } from "@/registry/new-york-v4/ui/skeleton"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/registry/new-york-v4/ui/tooltip"
const SIDEBAR_COOKIE_NAME = "sidebar_state"
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
const SIDEBAR_WIDTH = "16rem"
const SIDEBAR_WIDTH_MOBILE = "18rem"
const SIDEBAR_WIDTH_ICON = "3rem"
const SIDEBAR_KEYBOARD_SHORTCUT = "b"
type SidebarContextProps = {
state: "expanded" | "collapsed"
open: boolean
setOpen: (open: boolean) => void
openMobile: boolean
setOpenMobile: (open: boolean) => void
isMobile: boolean
toggleSidebar: () => void
}
const SidebarContext = React.createContext<SidebarContextProps | null>(null)
function useSidebar() {
const context = React.useContext(SidebarContext)
if (!context) {
throw new Error("useSidebar must be used within a SidebarProvider.")
}
return context
}
function SidebarProvider({
defaultOpen = true,
open: openProp,
onOpenChange: setOpenProp,
className,
// ... (667 more lines)
Domain
Subdomains
Functions
- Sidebar()
- SidebarContent()
- SidebarFooter()
- SidebarGroup()
- SidebarGroupAction()
- SidebarGroupContent()
- SidebarGroupLabel()
- SidebarHeader()
- SidebarInput()
- SidebarInset()
- SidebarMenu()
- SidebarMenuAction()
- SidebarMenuBadge()
- SidebarMenuButton()
- SidebarMenuItem()
- SidebarMenuSkeleton()
- SidebarMenuSub()
- SidebarMenuSubButton()
- SidebarMenuSubItem()
- SidebarProvider()
- SidebarRail()
- SidebarSeparator()
- SidebarTrigger()
- open()
- useSidebar()
Types
Dependencies
- button
- class-variance-authority
- input
- lucide-react
- radix-ui
- react
- separator
- sheet
- skeleton
- tooltip
- use-mobile
- utils
Source
Frequently Asked Questions
What does sidebar.tsx do?
sidebar.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in sidebar.tsx?
sidebar.tsx defines 25 function(s): Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, and 15 more.
What does sidebar.tsx depend on?
sidebar.tsx imports 12 module(s): button, class-variance-authority, input, lucide-react, radix-ui, react, separator, sheet, and 4 more.
Where is sidebar.tsx in the architecture?
sidebar.tsx is located at apps/v4/registry/new-york-v4/ui/sidebar.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/ui).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free