BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/9ui/scroll-area

scroll-area

9ui/scroll-area
FreeComponent

9ui publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by 9ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://9ui.dev/r/scroll-area.json

Source

ui/scroll-area.tsx9ui.dev/r/scroll-area.json
1import * as React from "react"
2import { ScrollArea as BaseScrollArea } from "@base-ui/react/scroll-area"
3
4import { cn } from "@/lib/utils"
5
6function ScrollArea({
7 className,
8 children,
9 orientation,
10 ...props
11}: React.ComponentProps<typeof BaseScrollArea.Root> & {
12 orientation?: "horizontal" | "vertical"
13}) {
14 return (
15 <BaseScrollArea.Root
16 data-slot="scroll-area"
17 className={cn("relative", className)}
18 {...props}
19 >
20 <BaseScrollArea.Viewport
21 data-slot="scroll-area-viewport"
22 className="focus-visible:ring-ring/50 size-full overscroll-contain rounded-[inherit] transition-[color,box-shadow] outline-none [--scroll-area-thumb-bg:inherit] [--scroll-area-thumb-hover-bg:inherit] focus-visible:ring-[3px] focus-visible:outline"
23 >
24 {children}
25 </BaseScrollArea.Viewport>
26 <ScrollBar orientation={orientation} />
27 <BaseScrollArea.Corner />
28 </BaseScrollArea.Root>
29 )
30}
31
32function ScrollBar({
33 className,
34 orientation = "vertical",
35 ...props
36}: React.ComponentProps<typeof BaseScrollArea.Scrollbar>) {
37 return (
38 <BaseScrollArea.Scrollbar
39 data-slot="scroll-area-scrollbar"
40 orientation={orientation}
41 className={cn(
42 "m-1 flex touch-none p-px opacity-0 transition-[border-color,opacity] delay-200 select-none data-hovering:opacity-100 data-hovering:delay-0 data-hovering:duration-100 data-scrolling:opacity-100 data-scrolling:delay-0 data-scrolling:duration-100",
43 orientation === "vertical" && "w-2.5 border-l border-l-transparent",
44 orientation === "horizontal" &&
45 "h-2.5 flex-col border-t border-t-transparent",
46 className
47 )}
48 {...props}
49 >
50 <BaseScrollArea.Thumb
51 data-slot="scroll-area-thumb"
52 className="bg-border relative flex-1 rounded-full"
53 />
54 </BaseScrollArea.Scrollbar>
55 )
56}
57
58export { ScrollArea }

Files it writes

  • src/components/ui/scroll-area.tsx

Facts

Registry
9ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on 9ui 9ui.dev borabaloglu/9ui on GitHub Raw registry item This item as JSON

More from 9ui

All 56 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordion9uiComponentsFreeno deps
alertalert9uiComponentsFreeno deps
alert-dialogalert-dialog9uiComponentsFreeno deps
aspect-ratioaspect-ratio9uiComponentsFreeno deps
autocompleteautocomplete9uiComponentsFreeno deps
avataravatar9uiComponentsFreeno deps
badgebadge9uiComponentsFreeno deps
breadcrumbsbreadcrumbs9uiComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex