Home / File/ sidebar.tsx — ui Source File

sidebar.tsx — ui Source File

Architecture documentation for sidebar.tsx, a tsx file in the ui codebase. 13 imports, 0 dependents.

File tsx DocumentationAtlas Changelog 13 imports 25 functions

Entity Profile

Dependency Diagram

graph LR
  334954a9_5573_f901_08c0_da02d404f69b["sidebar.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  334954a9_5573_f901_08c0_da02d404f69b --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  dfff40cc_d65b_ca49_a147_fd0eeff3f9de["use-mobile"]
  334954a9_5573_f901_08c0_da02d404f69b --> dfff40cc_d65b_ca49_a147_fd0eeff3f9de
  3d9438e8_7604_787c_4898_907262aff28b["utils"]
  334954a9_5573_f901_08c0_da02d404f69b --> 3d9438e8_7604_787c_4898_907262aff28b
  4544fa74_9b37_0912_c55e_f4ff161b8e83["button"]
  334954a9_5573_f901_08c0_da02d404f69b --> 4544fa74_9b37_0912_c55e_f4ff161b8e83
  9a309fc5_4306_d01f_08ce_72db23e48652["input"]
  334954a9_5573_f901_08c0_da02d404f69b --> 9a309fc5_4306_d01f_08ce_72db23e48652
  119ced82_d82e_5c63_584a_b08878b3fdbd["separator"]
  334954a9_5573_f901_08c0_da02d404f69b --> 119ced82_d82e_5c63_584a_b08878b3fdbd
  76bdfedb_09e9_30d5_272b_d0b8214c91f1["sheet"]
  334954a9_5573_f901_08c0_da02d404f69b --> 76bdfedb_09e9_30d5_272b_d0b8214c91f1
  cef38c81_d14a_1a57_fc9b_8b9a55d51a99["skeleton"]
  334954a9_5573_f901_08c0_da02d404f69b --> cef38c81_d14a_1a57_fc9b_8b9a55d51a99
  9612f2e9_e46d_ea6f_58cb_6612bdce7491["tooltip"]
  334954a9_5573_f901_08c0_da02d404f69b --> 9612f2e9_e46d_ea6f_58cb_6612bdce7491
  9c25e96d_58e7_da5f_38f2_06bde0124112["merge-props"]
  334954a9_5573_f901_08c0_da02d404f69b --> 9c25e96d_58e7_da5f_38f2_06bde0124112
  54befa66_d51c_07e2_ec3f_848afbcd88a7["use-render"]
  334954a9_5573_f901_08c0_da02d404f69b --> 54befa66_d51c_07e2_ec3f_848afbcd88a7
  25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"]
  334954a9_5573_f901_08c0_da02d404f69b --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  334954a9_5573_f901_08c0_da02d404f69b --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  style 334954a9_5573_f901_08c0_da02d404f69b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { useIsMobile } from "@/examples/base/hooks/use-mobile"
import { cn } from "@/examples/base/lib/utils"
import { Button } from "@/examples/base/ui/button"
import { Input } from "@/examples/base/ui/input"
import { Separator } from "@/examples/base/ui/separator"
import {
  Sheet,
  SheetContent,
  SheetDescription,
  SheetHeader,
  SheetTitle,
} from "@/examples/base/ui/sheet"
import { Skeleton } from "@/examples/base/ui/skeleton"
import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@/examples/base/ui/tooltip"
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
import { PanelLeftIcon } from "lucide-react"

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,
// ... (663 more lines)

Subdomains

Dependencies

  • button
  • class-variance-authority
  • input
  • lucide-react
  • merge-props
  • react
  • separator
  • sheet
  • skeleton
  • tooltip
  • use-mobile
  • use-render
  • utils

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, Changelog 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 13 module(s): button, class-variance-authority, input, lucide-react, merge-props, react, separator, sheet, and 5 more.
Where is sidebar.tsx in the architecture?
sidebar.tsx is located at apps/v4/examples/base/ui/sidebar.tsx (domain: DocumentationAtlas, subdomain: Changelog, directory: apps/v4/examples/base/ui).

Analyze Your Own Codebase

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

Try Supermodel Free