Home / File/ scroll-area.tsx — ui Source File

scroll-area.tsx — ui Source File

Architecture documentation for scroll-area.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 3 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  b342dec3_b110_5cbe_e60e_04a7eb899811["scroll-area.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  b342dec3_b110_5cbe_e60e_04a7eb899811 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"]
  b342dec3_b110_5cbe_e60e_04a7eb899811 --> 9c463da6_747b_38dc_586b_cbb4873070b1
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  b342dec3_b110_5cbe_e60e_04a7eb899811 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  style b342dec3_b110_5cbe_e60e_04a7eb899811 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"

import { cn } from "@/lib/utils"

function ScrollArea({
  className,
  children,
  ...props
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
  return (
    <ScrollAreaPrimitive.Root
      data-slot="scroll-area"
      className={cn("relative", className)}
      {...props}
    >
      <ScrollAreaPrimitive.Viewport
        data-slot="scroll-area-viewport"
        className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
      >
        {children}
      </ScrollAreaPrimitive.Viewport>
      <ScrollBar />
      <ScrollAreaPrimitive.Corner />
    </ScrollAreaPrimitive.Root>
  )
}

function ScrollBar({
  className,
  orientation = "vertical",
  ...props
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
  return (
    <ScrollAreaPrimitive.ScrollAreaScrollbar
      data-slot="scroll-area-scrollbar"
      orientation={orientation}
      className={cn(
        "flex touch-none p-px transition-colors select-none",
        orientation === "vertical" &&
          "h-full w-2.5 border-l border-l-transparent",
        orientation === "horizontal" &&
          "h-2.5 flex-col border-t border-t-transparent",
        className
      )}
      {...props}
    >
      <ScrollAreaPrimitive.ScrollAreaThumb
        data-slot="scroll-area-thumb"
        className="bg-border relative flex-1 rounded-full"
      />
    </ScrollAreaPrimitive.ScrollAreaScrollbar>
  )
}

export { ScrollArea, ScrollBar }

Subdomains

Dependencies

  • radix-ui
  • react
  • utils

Frequently Asked Questions

What does scroll-area.tsx do?
scroll-area.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in scroll-area.tsx?
scroll-area.tsx defines 2 function(s): ScrollArea, ScrollBar.
What does scroll-area.tsx depend on?
scroll-area.tsx imports 3 module(s): radix-ui, react, utils.
Where is scroll-area.tsx in the architecture?
scroll-area.tsx is located at apps/v4/registry/new-york-v4/ui/scroll-area.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/ui).

Analyze Your Own Codebase

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

Try Supermodel Free