Home / File/ charts-nav.tsx — ui Source File

charts-nav.tsx — ui Source File

Architecture documentation for charts-nav.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.

File tsx ComponentRegistry UIPrimitives 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  18e9739a_7a0f_2614_f9d9_5b98f95f324c["charts-nav.tsx"]
  ba3d44f3_7b34_f9cc_6283_44817785c0df["link"]
  18e9739a_7a0f_2614_f9d9_5b98f95f324c --> ba3d44f3_7b34_f9cc_6283_44817785c0df
  f5b0b1d9_de2f_9c31_0bcd_4adbd07581cb["navigation"]
  18e9739a_7a0f_2614_f9d9_5b98f95f324c --> f5b0b1d9_de2f_9c31_0bcd_4adbd07581cb
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  18e9739a_7a0f_2614_f9d9_5b98f95f324c --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  87012fb0_00c6_7ce4_2418_e4e3b26e5dac["scroll-area"]
  18e9739a_7a0f_2614_f9d9_5b98f95f324c --> 87012fb0_00c6_7ce4_2418_e4e3b26e5dac
  style 18e9739a_7a0f_2614_f9d9_5b98f95f324c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import Link from "next/link"
import { usePathname } from "next/navigation"

import { cn } from "@/lib/utils"
import { ScrollArea, ScrollBar } from "@/registry/new-york/ui/scroll-area"

const links = [
  {
    name: "All Charts",
    href: "/charts",
  },
  {
    name: "Area Chart",
    href: "/charts#area-chart",
  },
  {
    name: "Bar Chart",
    href: "/charts#bar-chart",
  },
  {
    name: "Line Chart",
    href: "/charts#line-chart",
  },
  {
    name: "Pie Chart",
    href: "/charts#pie-chart",
  },
  {
    name: "Radar Chart",
    href: "/charts#radar-chart",
  },
  {
    name: "Radial Chart",
    href: "/charts#radial-chart",
  },
  {
    name: "Tooltip",
    href: "/charts#tooltip",
  },
]

export function ChartsNav({
  className,
  ...props
}: React.ComponentProps<"div">) {
  const pathname = usePathname()

  return (
    <ScrollArea className="max-w-[600px] lg:max-w-none">
      <div className={cn("flex items-center", className)} {...props}>
        {links.map((example, index) => (
          <Link
            href={example.href}
            key={example.href}
            className={cn(
              "flex h-7 shrink-0 items-center justify-center rounded-full px-4 text-center text-sm font-medium transition-colors hover:text-primary",
              pathname?.startsWith(example.href) ||
                (index === 0 && pathname === "/charts")
                ? "bg-muted text-primary"
                : "text-muted-foreground"
            )}
          >
            {example.name}
          </Link>
        ))}
      </div>
      <ScrollBar orientation="horizontal" className="invisible" />
    </ScrollArea>
  )
}

Subdomains

Functions

Dependencies

  • link
  • navigation
  • scroll-area
  • utils

Frequently Asked Questions

What does charts-nav.tsx do?
charts-nav.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in charts-nav.tsx?
charts-nav.tsx defines 1 function(s): ChartsNav.
What does charts-nav.tsx depend on?
charts-nav.tsx imports 4 module(s): link, navigation, scroll-area, utils.
Where is charts-nav.tsx in the architecture?
charts-nav.tsx is located at deprecated/www/components/charts-nav.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: deprecated/www/components).

Analyze Your Own Codebase

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

Try Supermodel Free