Search documentation

Search components and pages

Scroll Area

Augments native scroll for custom, cross-browser styling.

01

Installation

Add the scroll area component with the shadcn CLI.

bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/scroll-area.json
02

Usage

tsx
import { ScrollArea } from "@/components/ui/scroll-area"
03

Examples

Default

import { ScrollArea } from "@/components/ui/scroll-area"

<ScrollArea className="h-40 w-56 border border-border p-3">
  <div className="space-y-2 text-sm">
    {items.map((item) => (
      <p key={item.id} className="text-muted-foreground">{item.label}</p>
    ))}
  </div>
</ScrollArea>