Scroll Area
edgecom/scroll-areaFreeComponent
The Edgecom Scroll Area component.
Live preview
live · rendered by the registry
Rendered by edgecom on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://design.edgecom.ai/r/scroll-area.jsonSource
1"use client"23import * as React from "react"4import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"56import { cn } from "@/lib/utils"78function ScrollArea({9 className,10 children,11 orientation = "vertical",12 ...props13}: ScrollAreaPrimitive.Root.Props & {14 orientation?: "vertical" | "horizontal" | "both"15}) {16 return (17 <ScrollAreaPrimitive.Root18 data-slot="scroll-area"19 className={cn("relative", className)}20 {...props}21 >22 <ScrollAreaPrimitive.Viewport23 data-slot="scroll-area-viewport"24 className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"25 >26 {children}27 </ScrollAreaPrimitive.Viewport>28 {(orientation === "vertical" || orientation === "both") && (29 <ScrollBar orientation="vertical" />30 )}31 {(orientation === "horizontal" || orientation === "both") && (32 <ScrollBar orientation="horizontal" />33 )}34 <ScrollAreaPrimitive.Corner />35 </ScrollAreaPrimitive.Root>36 )37}3839function ScrollBar({40 className,41 orientation = "vertical",42 ...props43}: ScrollAreaPrimitive.Scrollbar.Props) {44 return (45 <ScrollAreaPrimitive.Scrollbar46 data-slot="scroll-area-scrollbar"47 data-orientation={orientation}48 orientation={orientation}49 className={cn(50 "flex touch-none p-px transition-colors select-none data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",51 className52 )}53 {...props}54 >55 <ScrollAreaPrimitive.Thumb56 data-slot="scroll-area-thumb"57 className="relative flex-1 rounded-full bg-border"58 />59 </ScrollAreaPrimitive.Scrollbar>60 )61}6263export { ScrollArea, ScrollBar }
What it pulls in
npm packages
Other registry items
Files it writes
More from edgecom
All 66 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | edgecom | Components | Free | 2 deps | |
| Alertalert | edgecom | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | edgecom | Components | Free | 1 dep | |
| Avataravatar | edgecom | Components | Free | 1 dep | |
| Badgebadge | edgecom | Components | Free | 2 deps | |
| Bannerbanner | edgecom | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | edgecom | Components | Free | 2 deps | |
| Buttonbutton | edgecom | Components | Free | 2 deps |
