MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / SidebarMenuAction

Function SidebarMenuAction

packages/react/src/components/sidebar.tsx:523–553  ·  view source on GitHub ↗
({
  className,
  asChild = false,
  showOnHover = false,
  ...props
}: React.ComponentProps<"button"> & {
  asChild?: boolean;
  showOnHover?: boolean;
})

Source from the content-addressed store, hash-verified

521}
522
523function SidebarMenuAction({
524 className,
525 asChild = false,
526 showOnHover = false,
527 ...props
528}: React.ComponentProps<"button"> & {
529 asChild?: boolean;
530 showOnHover?: boolean;
531}) {
532 const Comp = asChild ? Slot.Root : "button";
533
534 return (
535 <Comp
536 data-slot="sidebar-menu-action"
537 data-sidebar="menu-action"
538 className={cn(
539 "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
540 // Increases the hit area of the button on mobile.
541 "after:absolute after:-inset-2 md:after:hidden",
542 "peer-data-[size=sm]/menu-button:top-1",
543 "peer-data-[size=default]/menu-button:top-1.5",
544 "peer-data-[size=lg]/menu-button:top-2.5",
545 "group-data-[collapsible=icon]:hidden",
546 showOnHover &&
547 "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0",
548 className,
549 )}
550 {...props}
551 />
552 );
553}
554
555function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">) {
556 return (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected