Home / Function/ DocsNavItems() — ui Function Reference

DocsNavItems() — ui Function Reference

Architecture documentation for the DocsNavItems() function in docs-nav.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  61f8d3b2_55ad_8cc9_092b_9f1496e1c578["DocsNavItems()"]
  1273d0bf_53e4_2800_7b23_666a52cfde0e["docs-nav.tsx"]
  61f8d3b2_55ad_8cc9_092b_9f1496e1c578 -->|defined in| 1273d0bf_53e4_2800_7b23_666a52cfde0e
  style 61f8d3b2_55ad_8cc9_092b_9f1496e1c578 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/components/docs-nav.tsx lines 36–86

function DocsNavItems({
  items,
  pathname,
}: {
  items: SidebarNavItem[]
  pathname: string | null
}) {
  return items?.length ? (
    <div className="grid grid-flow-row auto-rows-max gap-0.5 text-sm">
      {items.map((item, index) =>
        item.href && !item.disabled ? (
          <Link
            key={index}
            href={item.href}
            className={cn(
              "group relative flex h-8 w-full items-center rounded-lg px-2 after:absolute after:inset-x-0 after:inset-y-[-2px]  after:rounded-lg hover:bg-accent hover:text-accent-foreground ",
              item.disabled && "cursor-not-allowed opacity-60",
              pathname === item.href
                ? "bg-accent font-medium text-accent-foreground"
                : "font-normal text-foreground"
            )}
            target={item.external ? "_blank" : ""}
            rel={item.external ? "noreferrer" : ""}
          >
            {item.title}
            {item.label && (
              <span className="ml-2 rounded-md bg-[#adfa1d] px-1.5 py-0.5 text-xs leading-none text-[#000000] no-underline group-hover:no-underline">
                {item.label}
              </span>
            )}
          </Link>
        ) : (
          <span
            key={index}
            className={cn(
              "flex w-full cursor-not-allowed items-center rounded-md p-2 text-muted-foreground hover:underline",
              item.disabled && "cursor-not-allowed opacity-60"
            )}
          >
            {item.title}
            {item.label && (
              <span className="ml-2 rounded-md bg-muted px-1.5 py-0.5 text-xs leading-none text-muted-foreground no-underline group-hover:no-underline">
                {item.label}
              </span>
            )}
          </span>
        )
      )}
    </div>
  ) : null
}

Subdomains

Frequently Asked Questions

What does DocsNavItems() do?
DocsNavItems() is a function in the ui codebase, defined in deprecated/www/components/docs-nav.tsx.
Where is DocsNavItems() defined?
DocsNavItems() is defined in deprecated/www/components/docs-nav.tsx at line 36.

Analyze Your Own Codebase

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

Try Supermodel Free