Skip to content
Layout

ScrollArea

Scrollable viewport with optional edge fade masks.

ScrollArea

Scrollable viewport with optional edge fade masks driven by CSS scroll-driven animations. Set orientation for the scroll axis and fade for edge masks.

Examples

Default

A fixed-height vertical viewport without fades.

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6

Demo.tsxtsx
import { ScrollArea } from '@var-ui/react';

<ScrollArea style={{ height: 120, width: 240 }}>
  <p>Long content…</p>
</ScrollArea>

Fade

Enable edge fades with fade (true follows orientation, or pass "vertical" / "horizontal" / "both"). Scroll to see masks appear at the edges.

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6

Line 7

Line 8

Demo.tsxtsx
import { ScrollArea } from '@var-ui/react';

<ScrollArea fade="vertical" style={{ height: 120, width: 240 }}>
  <p>Long content…</p>
</ScrollArea>

Props

Accessibility

The root and viewport are plain divs. Prefer putting focusable content inside the scrollable region; fades are decorative (aria-hidden). Pass viewportRef when you need to control scroll position programmatically.