Home / Function/ SidebarMenuAction() — ui Function Reference

SidebarMenuAction() — ui Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  02e84861_b1e3_ae16_6f63_ce078bbefca9["SidebarMenuAction()"]
  0dd28c0a_4131_40f2_8cf0_e0611d33faf6["sidebar.tsx"]
  02e84861_b1e3_ae16_6f63_ce078bbefca9 -->|defined in| 0dd28c0a_4131_40f2_8cf0_e0611d33faf6
  style 02e84861_b1e3_ae16_6f63_ce078bbefca9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/new-york-v4/ui/sidebar.tsx lines 548–578

function SidebarMenuAction({
  className,
  asChild = false,
  showOnHover = false,
  ...props
}: React.ComponentProps<"button"> & {
  asChild?: boolean
  showOnHover?: boolean
}) {
  const Comp = asChild ? Slot.Root : "button"

  return (
    <Comp
      data-slot="sidebar-menu-action"
      data-sidebar="menu-action"
      className={cn(
        "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
        // Increases the hit area of the button on mobile.
        "after:absolute after:-inset-2 md:after:hidden",
        "peer-data-[size=sm]/menu-button:top-1",
        "peer-data-[size=default]/menu-button:top-1.5",
        "peer-data-[size=lg]/menu-button:top-2.5",
        "group-data-[collapsible=icon]:hidden",
        showOnHover &&
          "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
        className
      )}
      {...props}
    />
  )
}

Subdomains

Frequently Asked Questions

What does SidebarMenuAction() do?
SidebarMenuAction() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/ui/sidebar.tsx.
Where is SidebarMenuAction() defined?
SidebarMenuAction() is defined in apps/v4/registry/new-york-v4/ui/sidebar.tsx at line 548.

Analyze Your Own Codebase

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

Try Supermodel Free