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

Function SidebarTrigger

src/components/ui/sidebar.tsx:256–280  ·  view source on GitHub ↗
({
  className,
  onClick,
  ...props
}: React.ComponentProps<typeof Button>)

Source from the content-addressed store, hash-verified

254}
255
256function SidebarTrigger({
257 className,
258 onClick,
259 ...props
260}: React.ComponentProps<typeof Button>) {
261 const { toggleSidebar } = useSidebar()
262
263 return (
264 <Button
265 data-sidebar="trigger"
266 data-slot="sidebar-trigger"
267 variant="ghost"
268 size="icon"
269 className={cn("size-7", className)}
270 onClick={(event) => {
271 onClick?.(event)
272 toggleSidebar()
273 }}
274 {...props}
275 >
276 <PanelLeftIcon />
277 <span className="sr-only">Toggle Sidebar</span>
278 </Button>
279 )
280}
281
282function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
283 const { toggleSidebar } = useSidebar()

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useSidebarFunction · 0.85

Tested by

no test coverage detected