Scroll Area
uiable/scroll-areaFreeComponent
Scroll Area component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/scroll-area.jsonSource
1"use client";23import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";45import { cn } from "@/lib/utils";67function ScrollArea({8 className,9 children,10 ...props11}: ScrollAreaPrimitive.Root.Props) {12 return (13 <ScrollAreaPrimitive.Root14 data-slot="scroll-area"15 className={cn("relative", className)}16 {...props}17 >18 <ScrollAreaPrimitive.Viewport19 data-slot="scroll-area-viewport"20 className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"21 >22 {children}23 </ScrollAreaPrimitive.Viewport>24 <ScrollBar />25 <ScrollAreaPrimitive.Corner />26 </ScrollAreaPrimitive.Root>27 );28}2930function ScrollBar({31 className,32 orientation = "vertical",33 ...props34}: ScrollAreaPrimitive.Scrollbar.Props) {35 return (36 <ScrollAreaPrimitive.Scrollbar37 data-slot="scroll-area-scrollbar"38 data-orientation={orientation}39 orientation={orientation}40 className={cn(41 "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",42 className43 )}44 {...props}45 >46 <ScrollAreaPrimitive.Thumb47 data-slot="scroll-area-thumb"48 className="bg-border relative flex-1 rounded-full"49 />50 </ScrollAreaPrimitive.Scrollbar>51 );52}5354export { ScrollArea, ScrollBar };
What it pulls in
npm packages
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps |
