Home / Function/ SidebarRail() — ui Function Reference

SidebarRail() — ui Function Reference

Architecture documentation for the SidebarRail() function in sidebar.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  af1fb2ed_a6f7_8e3d_28ff_41ff3babde23["SidebarRail()"]
  91f6d996_a9f5_b129_3201_f8eee4d8cf65["sidebar.tsx"]
  af1fb2ed_a6f7_8e3d_28ff_41ff3babde23 -->|defined in| 91f6d996_a9f5_b129_3201_f8eee4d8cf65
  8c62ffec_57d5_c92b_d4f9_ed885df7d00a["useSidebar()"]
  af1fb2ed_a6f7_8e3d_28ff_41ff3babde23 -->|calls| 8c62ffec_57d5_c92b_d4f9_ed885df7d00a
  style af1fb2ed_a6f7_8e3d_28ff_41ff3babde23 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/bases/base/ui/sidebar.tsx lines 287–310

function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
  const { toggleSidebar } = useSidebar()

  return (
    <button
      data-sidebar="rail"
      data-slot="sidebar-rail"
      aria-label="Toggle Sidebar"
      tabIndex={-1}
      onClick={toggleSidebar}
      title="Toggle Sidebar"
      className={cn(
        "cn-sidebar-rail absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
        "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
        "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
        "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
        "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
        "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
        className
      )}
      {...props}
    />
  )
}

Subdomains

Calls

Frequently Asked Questions

What does SidebarRail() do?
SidebarRail() is a function in the ui codebase, defined in apps/v4/registry/bases/base/ui/sidebar.tsx.
Where is SidebarRail() defined?
SidebarRail() is defined in apps/v4/registry/bases/base/ui/sidebar.tsx at line 287.
What does SidebarRail() call?
SidebarRail() calls 1 function(s): useSidebar.

Analyze Your Own Codebase

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

Try Supermodel Free