---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Scroll area

A region of content that scrolls behind thin bars that float over its edge, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `ScrollArea`.

## Try it

Scroll the team with the wheel, the thumb or the keys after Tab; switch the bars to stay shown.

The team is our own sample list.

## When to use

- A region of content that scrolls behind thin bars that float over its edge.

## When not to use

- For a whole page leave the browser's own scrolling.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Scroll area on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-scroll-area.json --yes
```

```text
Add the Goop Scroll area to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { ScrollArea } from '@/components/ui/goop/scroll-area';
import { Card } from '@/components/ui/goop/card';

<Card variant="outline" className="h-60 p-0">
  <ScrollArea fade aria-label="Team" className="h-full">
    <ul className="flex flex-col p-1.5">
      {['Teodora Valk', 'Bilal Rashed', 'Ngozi Ilori', 'Yuto Sakamaki', 'Dagny Holm', 'Cormac Foley'].map((name) => (
        <li key={name} className="px-2 py-1.5 text-base">
          {name}
        </li>
      ))}
    </ul>
  </ScrollArea>
</Card>
```

- Fits: inbox, chat: aside.
- Also known as: ScrollView, ScrollContainer, CustomScrollbar, Scrollable.
- height, width, padding, corner, background, motion: add no class for these.

## API reference

### Options

- `orientation?: 'vertical' | 'horizontal' | 'both' = 'vertical'` — The ways it scrolls: `vertical`, `horizontal` or `both`.
- `type?: 'auto' | 'always' = 'auto'` — `auto`: the bars show while hovered or scrolling; `always`: they stay.
- `fade?: boolean = false` — Fade the content out at each edge that hides more of it.
- `aria-label?: string` — The region's name, set on the viewport that scrolls.
- `aria-labelledby?: string` — The id of the element naming the region, set on the viewport.
- `viewportRef?: ComponentProps<'div'>['ref']` — The element that scrolls, to read or set its position.
- `children?: ReactNode`

## Keyboard

- Tab: move to the region when its content overflows, then on
- ArrowUp / ArrowDown: scroll the content a line
- ArrowLeft / ArrowRight: scroll a region that scrolls across a step sideways
- PageUp / PageDown / Space: scroll the content a page
- Home / End: scroll to the content's start or end

## Accessibility

- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
- hover, focus-visible: the browser's own (:hover, :focus-visible): write nothing

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Card](/themes/trail/components/card): A framed surface that holds one piece of content or a list of settings rows.
- [Resizable panel group](/themes/trail/components/resizable): Panes a person resizes by dragging the handle between them, or with its keys.
- [Footer](/themes/trail/components/footer): The closing band of a marketing or a docs page, with its groups of links, legal text and small print.
- [Toolbar](/themes/trail/components/toolbar): A row of controls over a list, such as a period select and its filter and view buttons.
