# Scroll area with horizontal scrollbar

> Scroll area with horizontal scrollbar

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-scroll-area-2).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-scroll-area-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-scroll-area-2-light-4817cae19d6ef873.png
- Registry item: https://reui.io/r/new-york-v4/c-scroll-area-2.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-scroll-area-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `scroll-area`

## Files

### `c-scroll-area-2.tsx`

```tsx
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"

export function Pattern() {
  return (
    <ScrollArea className="rounded-2xl h-auto max-w-96 border">
      <div className="flex w-max gap-4 p-4">
        {Array.from({ length: 10 }).map((_, i) => (
          <div
            key={i}
            className="rounded-2xl relative h-36 w-40 shrink-0 overflow-hidden border"
          >
            <img
              src={`https://picsum.photos/400/300?random=${i + 1}`}
              alt={`Image ${i + 1}`}
              className="h-full w-full object-cover"
            />
          </div>
        ))}
      </div>
      <ScrollBar orientation="horizontal" />
    </ScrollArea>
  )
}
```
