Skip to content

Scroll Views

ScrollArea wraps overflowing content in a viewport with consistent, styled scrollbars that look the same across browsers and platforms. Reach for it whenever a fixed-height region needs to scroll, such as a long list, a code block, or a sidebar of tags, and you want the scrollbar to match the design system rather than the OS default.

Live demo

The component below is the real one the app ships.

Risers

Riser 1
Riser 2
Riser 3
Riser 4
Riser 5
Riser 6
Riser 7
Riser 8
Riser 9
Riser 10
Riser 11
Riser 12
Riser 13
Riser 14
Riser 15
Riser 16
Riser 17
Riser 18
Riser 19
Riser 20
Riser 21
Riser 22
Riser 23
Riser 24
Riser 25
Riser 26
Riser 27
Riser 28
Riser 29
Riser 30
Riser 31
Riser 32
Riser 33
Riser 34
Riser 35
Riser 36
Riser 37
Riser 38
Riser 39
Riser 40
Riser 41
Riser 42
Riser 43
Riser 44
Riser 45
Riser 46
Riser 47
Riser 48
Riser 49
Riser 50

Usage

Source: scroll-area.tsx

import { ScrollArea, Separator } from "@beacon/design-system";
const tags = Array.from({ length: 50 }, (_, i) => `Tag ${i + 1}`);
<ScrollArea className="h-72 w-48 rounded-md border">
<div className="p-4">
<h4 className="mb-4 text-sm font-medium leading-none">Tags</h4>
{tags.map((tag) => (
<div key={tag}>
<div className="text-sm">{tag}</div>
<Separator className="my-2" />
</div>
))}
</div>
</ScrollArea>

Parts

PartRole
ScrollAreaThe container. Set a fixed height (or width) via className; it renders the viewport, a vertical ScrollBar, and a corner automatically.
ScrollBarThe styled scrollbar. Rendered automatically inside ScrollArea; render it yourself with orientation="horizontal" when you need a horizontal bar.

ScrollBar props

PropTypeDefaultDescription
orientation"vertical" | "horizontal""vertical"Which axis the scrollbar controls.

When to use

  • Fixed-height regions that overflow: long lists, log output, tag clusters, sidebars.
  • Anywhere you want scrollbars to match the design system across browsers and platforms.

Do not wrap the whole page in a ScrollArea: let the document scroll natively. Reserve it for bounded regions with their own overflow.