Scroll Area

A native scroll container with custom scrollbars.

Usage

API Reference

ScrollArea

Root component. Includes custom scrollbar styling.

ScrollAreaViewport

Scrollable viewport container.

ScrollAreaScrollbar

Scrollbar track.

ScrollAreaThumb

Scrollbar thumb.

ScrollAreaCorner

Corner element when both scrollbars are visible.

Examples

Scroll Fade

Use scrollFade to mask the viewport edges so content subtly fades in and out as you scroll, hinting that more content is available without adding extra UI chrome.

Horizontal Scroll

Scrollbar Gutter

Enable scrollbarGutter to reserve space for the scrollbar when overflow appears, preventing layout shifts as the bar shows or hides.

Both Scrollbars

Fill viewport (flex layouts)

Use fill when the scroll area wraps a flex column that should stretch to the full viewport height—for example, pinning a footer with mt-auto inside a sidebar. The built-in SidebarContent part already passes fill; opt in manually for custom layouts:

Leave fill at the default (false) for content-sized areas such as lists, comboboxes, and dialogs where overflow should track child height.

Content min-width

The content wrapper sets min-width: fit-content by default, which often causes unwanted horizontal scroll in vertical lists and panels (dialogs, comboboxes, sidebars). clampContentMinWidth defaults to true and applies minWidth: 0 to prevent that.

Horizontal scroll still works when children define their own width (e.g. w-max, table min-width). Set clampContentMinWidth={false} only if horizontal scroll stops working and the child has no explicit width—rare cases like certain flex chains or long unbreakable inline text without overflow handling.