MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / SidebarRail

Function SidebarRail

src/components/ui/sidebar.tsx:282–305  ·  view source on GitHub ↗
({ className, ...props }: React.ComponentProps<"button">)

Source from the content-addressed store, hash-verified

280}
281
282function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
283 const { toggleSidebar } = useSidebar()
284
285 return (
286 <button
287 data-sidebar="rail"
288 data-slot="sidebar-rail"
289 aria-label="Toggle Sidebar"
290 tabIndex={-1}
291 onClick={toggleSidebar}
292 title="Toggle Sidebar"
293 className={cn(
294 "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
295 "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
296 "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
297 "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
298 "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
299 "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
300 className
301 )}
302 {...props}
303 />
304 )
305}
306
307function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
308 return (

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useSidebarFunction · 0.85

Tested by

no test coverage detected