Home / Function/ SidebarMenuSkeleton() — ui Function Reference

SidebarMenuSkeleton() — ui Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  1582cf1c_1f13_1a01_396f_e9bef53a9535["SidebarMenuSkeleton()"]
  403a7802_5284_b88e_6793_ca6286c4d07c["sidebar.tsx"]
  1582cf1c_1f13_1a01_396f_e9bef53a9535 -->|defined in| 403a7802_5284_b88e_6793_ca6286c4d07c
  style 1582cf1c_1f13_1a01_396f_e9bef53a9535 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/ui-rtl/sidebar.tsx lines 582–618

function SidebarMenuSkeleton({
  className,
  showIcon = false,
  ...props
}: React.ComponentProps<"div"> & {
  showIcon?: boolean
}) {
  // Random width between 50 to 90%.
  const [width] = React.useState(() => {
    return `${Math.floor(Math.random() * 40) + 50}%`
  })

  return (
    <div
      data-slot="sidebar-menu-skeleton"
      data-sidebar="menu-skeleton"
      className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
      {...props}
    >
      {showIcon && (
        <Skeleton
          className="size-4 rounded-md"
          data-sidebar="menu-skeleton-icon"
        />
      )}
      <Skeleton
        className="h-4 max-w-(--skeleton-width) flex-1"
        data-sidebar="menu-skeleton-text"
        style={
          {
            "--skeleton-width": width,
          } as React.CSSProperties
        }
      />
    </div>
  )
}

Subdomains

Frequently Asked Questions

What does SidebarMenuSkeleton() do?
SidebarMenuSkeleton() is a function in the ui codebase, defined in apps/v4/examples/radix/ui-rtl/sidebar.tsx.
Where is SidebarMenuSkeleton() defined?
SidebarMenuSkeleton() is defined in apps/v4/examples/radix/ui-rtl/sidebar.tsx at line 582.

Analyze Your Own Codebase

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

Try Supermodel Free