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 DocumentationAtlas Changelog 3 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  85b34856_f6c0_cbb4_a758_a0655f7bbf0a["scroll-area.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  85b34856_f6c0_cbb4_a758_a0655f7bbf0a --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  3d9438e8_7604_787c_4898_907262aff28b["utils"]
  85b34856_f6c0_cbb4_a758_a0655f7bbf0a --> 3d9438e8_7604_787c_4898_907262aff28b
  73fd985d_8aa8_03ff_b628_718471e4602b["scroll-area"]
  85b34856_f6c0_cbb4_a758_a0655f7bbf0a --> 73fd985d_8aa8_03ff_b628_718471e4602b
  style 85b34856_f6c0_cbb4_a758_a0655f7bbf0a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { cn } from "@/examples/base/lib/utils"
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"

function ScrollArea({
  className,
  children,
  ...props
}: ScrollAreaPrimitive.Root.Props) {
  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
}: ScrollAreaPrimitive.Scrollbar.Props) {
  return (
    <ScrollAreaPrimitive.Scrollbar
      data-slot="scroll-area-scrollbar"
      data-orientation={orientation}
      orientation={orientation}
      className={cn(
        "flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",
        className
      )}
      {...props}
    >
      <ScrollAreaPrimitive.Thumb
        data-slot="scroll-area-thumb"
        className="bg-border relative flex-1 rounded-full"
      />
    </ScrollAreaPrimitive.Scrollbar>
  )
}

export { ScrollArea, ScrollBar }

Subdomains

Dependencies

  • react
  • scroll-area
  • 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 DocumentationAtlas domain, Changelog 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): react, scroll-area, utils.
Where is scroll-area.tsx in the architecture?
scroll-area.tsx is located at apps/v4/examples/base/ui/scroll-area.tsx (domain: DocumentationAtlas, subdomain: Changelog, directory: apps/v4/examples/base/ui).

Analyze Your Own Codebase

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

Try Supermodel Free