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 403a7802_5284_b88e_6793_ca6286c4d07c["sidebar.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 08a0262d_09c3_24fd_0121_edb115ae800b["use-mobile"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 08a0262d_09c3_24fd_0121_edb115ae800b 191e4a89_25e4_f7a3_d5fb_d71d101e0990["utils"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 191e4a89_25e4_f7a3_d5fb_d71d101e0990 c79cdc74_50fb_62bd_465f_35936d2c5eac["button"] 403a7802_5284_b88e_6793_ca6286c4d07c --> c79cdc74_50fb_62bd_465f_35936d2c5eac 3d4e1aa6_8242_bf41_73c3_09dcaa04d08b["input"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 3d4e1aa6_8242_bf41_73c3_09dcaa04d08b 5f4cd78d_6790_583a_dafd_9fbe550c5cb6["separator"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 5f4cd78d_6790_583a_dafd_9fbe550c5cb6 7b8f71aa_712d_228c_ad75_b824915b592c["sheet"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 7b8f71aa_712d_228c_ad75_b824915b592c 21c6918c_f1ed_93c0_88cd_106de4d5aacf["skeleton"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 21c6918c_f1ed_93c0_88cd_106de4d5aacf e1e72e3d_096c_d5d6_5b8c_25c2c35904b5["tooltip"] 403a7802_5284_b88e_6793_ca6286c4d07c --> e1e72e3d_096c_d5d6_5b8c_25c2c35904b5 25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"] 403a7802_5284_b88e_6793_ca6286c4d07c --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3 9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"] 403a7802_5284_b88e_6793_ca6286c4d07c --> 9c463da6_747b_38dc_586b_cbb4873070b1 style 403a7802_5284_b88e_6793_ca6286c4d07c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { useIsMobile } from "@/examples/radix/hooks/use-mobile"
import { cn } from "@/examples/radix/lib/utils"
import { Button } from "@/examples/radix/ui-rtl/button"
import { Input } from "@/examples/radix/ui-rtl/input"
import { Separator } from "@/examples/radix/ui-rtl/separator"
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
} from "@/examples/radix/ui-rtl/sheet"
import { Skeleton } from "@/examples/radix/ui-rtl/skeleton"
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/examples/radix/ui-rtl/tooltip"
import { cva, type VariantProps } from "class-variance-authority"
import { PanelLeftIcon } from "lucide-react"
import { Slot } from "radix-ui"
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,
style,
children,
// ... (642 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 DocumentationAtlas domain, ContentSourcing 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/examples/radix/ui-rtl/sidebar.tsx (domain: DocumentationAtlas, subdomain: ContentSourcing, directory: apps/v4/examples/radix/ui-rtl).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free