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

colors-nav.tsx — ui Source File

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

File tsx Internationalization RTLLayout 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  423c1f34_0c68_e6b6_fcd6_b0d9efa4828f["colors-nav.tsx"]
  ba3d44f3_7b34_f9cc_6283_44817785c0df["link"]
  423c1f34_0c68_e6b6_fcd6_b0d9efa4828f --> ba3d44f3_7b34_f9cc_6283_44817785c0df
  f5b0b1d9_de2f_9c31_0bcd_4adbd07581cb["navigation"]
  423c1f34_0c68_e6b6_fcd6_b0d9efa4828f --> f5b0b1d9_de2f_9c31_0bcd_4adbd07581cb
  5281a958_99ee_42f0_65d8_3fb6d850517a["colors"]
  423c1f34_0c68_e6b6_fcd6_b0d9efa4828f --> 5281a958_99ee_42f0_65d8_3fb6d850517a
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  423c1f34_0c68_e6b6_fcd6_b0d9efa4828f --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  47fa1d7a_8370_cd8e_01f5_44e7f16431cc["scroll-area"]
  423c1f34_0c68_e6b6_fcd6_b0d9efa4828f --> 47fa1d7a_8370_cd8e_01f5_44e7f16431cc
  style 423c1f34_0c68_e6b6_fcd6_b0d9efa4828f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

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

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

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

  return (
    <div className={cn("flex items-center", className)} {...props}>
      <ScrollArea className="max-w-full">
        <div className="flex items-center">
          {colors.map((colorPalette, index) => (
            <Link
              href={`/colors#${colorPalette.name}`}
              key={colorPalette.name}
              data-active={
                pathname?.startsWith(colorPalette.name) ||
                (index === 0 && pathname === "/colors")
              }
              className={cn(
                "text-muted-foreground hover:text-primary data-[active=true]:text-primary flex h-7 items-center justify-center px-4 text-center text-base font-medium capitalize transition-colors"
              )}
            >
              {colorPalette.name}
            </Link>
          ))}
        </div>
        <ScrollBar orientation="horizontal" className="invisible" />
      </ScrollArea>
    </div>
  )
}

Subdomains

Functions

Dependencies

  • colors
  • link
  • navigation
  • scroll-area
  • utils

Frequently Asked Questions

What does colors-nav.tsx do?
colors-nav.tsx is a source file in the ui codebase, written in tsx. It belongs to the Internationalization domain, RTLLayout subdomain.
What functions are defined in colors-nav.tsx?
colors-nav.tsx defines 1 function(s): ColorsNav.
What does colors-nav.tsx depend on?
colors-nav.tsx imports 5 module(s): colors, link, navigation, scroll-area, utils.
Where is colors-nav.tsx in the architecture?
colors-nav.tsx is located at apps/v4/components/colors-nav.tsx (domain: Internationalization, subdomain: RTLLayout, directory: apps/v4/components).

Analyze Your Own Codebase

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

Try Supermodel Free