Scroll Area
rivelle/scroll-areaFreeComponent
A native-scrolling viewport with refined custom scrollbars.
Live preview
live · rendered by the registry
Rendered by rivelle on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://rivelle.dev/r/scroll-area.jsonSource
1"use client"23import * as React from "react"4import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"56import { cn } from "@/lib/utils"78function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {9 return (10 <ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn("relative overflow-hidden", className)} {...props}>11 <ScrollAreaPrimitive.Viewport data-slot="scroll-area-viewport" className="size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring/45">12 {children}13 </ScrollAreaPrimitive.Viewport>14 <ScrollBar />15 <ScrollAreaPrimitive.Corner />16 </ScrollAreaPrimitive.Root>17 )18}1920function ScrollBar({ className, orientation = "vertical", ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {21 return (22 <ScrollAreaPrimitive.ScrollAreaScrollbar23 data-slot="scroll-area-scrollbar"24 orientation={orientation}25 className={cn("flex touch-none select-none p-0.5 transition-colors data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5", className)}26 {...props}27 >28 <ScrollAreaPrimitive.ScrollAreaThumb data-slot="scroll-area-thumb" className="relative flex-1 rounded-full bg-foreground/18 transition-colors hover:bg-foreground/28" />29 </ScrollAreaPrimitive.ScrollAreaScrollbar>30 )31}3233export { ScrollArea, ScrollBar }
What it pulls in
npm packages
Other registry items
Files it writes
More from rivelle
All 83 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | rivelle | Components | Free | 2 deps | |
| Alertalert | rivelle | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | rivelle | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | rivelle | Components | Free | 1 dep | |
| Avataravatar | rivelle | Components | Free | 1 dep | |
| Badgebadge | rivelle | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | rivelle | Components | Free | 2 deps | |
| Buttonbutton | rivelle | Components | Free | 2 deps |
