Park UI

Scroll Area

A layout component for creating scrollable areas with custom scrollbars.

Installation

Usage

Examples

Variants

Use the variant prop to change the scrollbar visibility behavior.

Variant: auto

Variant: visible

Sizes

Use the size prop to change the size of the scroll area. This affects the scrollbar thickness and content padding.

Size: xs

Size: sm

Size: md

Size: lg

Horizontal

The scroll area automatically supports horizontal scrolling when content overflows horizontally.

Virtualization

Use @tanstack/react-virtual to handle large datasets efficiently by rendering only visible items.

Props

Root

PropDefaultType
variant'auto'
'auto' | 'visible'
size'md'
'xs' | 'sm' | 'md' | 'lg'
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

ids
Partial<{ root: string; viewport: string; content: string; scrollbar: string; thumb: string }>

The ids of the scroll area elements

Scrollbar

PropDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

orientation
Orientation