Scroll Area
A scrolling region with macOS overlay scrollers that appear while you scroll.
import { ScrollArea } from "@/components/ui/scroll-area"
const versions = Array.from({ length: 30 }, (_, index) => `macOS 27.${(index * 7) % 10}.${index % 4} (Build 26A${300 + index})`)
// Scroll to see the overlay scroller; hover it to widen it.
export default function ScrollAreaDemo() {
return (
<ScrollArea className="h-56 w-64 rounded-[12px] bg-mac-content shadow-[0_0_0_1px_var(--mac-grid)]">
<div className="p-3">
<div className="mb-2 text-mac-subheadline font-semibold text-mac-label-secondary">Software Updates</div>
{versions.map((version) => (
<div key={version} className="border-b border-mac-grid py-1.5 text-mac-body text-mac-label last:border-0">
{version}
</div>
))}
</div>
</ScrollArea>
)
}Installation
pnpm dlx shadcn@latest add @cupertinoui/scroll-areaThe first install also adds the macOS theme. See Installation to set up the registry.
Usage
import { ScrollArea } from "@/components/ui/scroll-area"
<ScrollArea className="h-56">…</ScrollArea>API Reference
Every part forwards the props of the underlying Base UI Scroll Area part. The props below are the ones CupertinoUI adds or changes.
ScrollArea / ScrollBar
| Prop | Type | Description |
|---|---|---|
orientation | "vertical" | "horizontal"Default: "vertical" | ScrollBar's direction; add a horizontal one for wide content. |
className | string | Extra classes, merged with the component's own. |