ScrollArea

A scroll container with custom scrollbars.

Base UI Scroll AreaSource

Vertical

Use this for long content in a region with a fixed height, such as a list in a card or a sidebar. Move the pointer onto the area or scroll it to show the scrollbar.

Horizontal

Set orientation="horizontal" on the scrollbar. The content grows to the width of its items.

Edge fades

Use edge fades when the scrollbar is hidden and users may not see that the content scrolls. Set edgeFades on Viewport. An edge fades only while content continues past it.

Vertical
Horizontal

Usage

These are defaults, not laws. Break one when you have a good reason, or when it makes the design more cohesive or more interesting.

  • Give ScrollArea.Root a fixed height, such as h-40. A max height alone does not make it scroll.
  • Add a ScrollArea.Scrollbar for each direction that scrolls. Add ScrollArea.Corner when both directions scroll.

API

Props that the library adds. Every part also takes all the Base UI props.

ScrollArea.Viewport

PropTypeDefaultDescription
edgeFadesbooleanfalseAdds 24px CSS masks at edges with more content. Supports both axes and RTL.