Skip to content
GitHub

Surfaces

ScrollArea

A box that scrolls, with a scrollbar that looks the same everywhere.

When to reach for it

A bounded panel — a long option list, a log. For page-level or prose scroll the scroll-slim utility is lighter and needs no component.

Examples

default

  • 1a2b3c4deployed
  • 1a2d2b3deployed
  • 1a2f1a2deployed
  • 1a31091rolled back
  • 1a32f80deployed
  • 1a34e6fdeployed
  • 1a36d5edeployed
  • 1a38c4ddeployed
  • 1a3ab3crolled back
  • 1a3ca2bdeployed
  • 1a3e91adeployed
  • 1a40809deployed
  • 1a426f8deployed
  • 1a445e7rolled back
  • 1a464d6deployed
  • 1a483c5deployed
  • 1a4a2b4deployed
  • 1a4c1a3deployed

Notes

A box that scrolls, with a scrollbar that looks the same on every platform.

The reason to reach for this over overflow-auto is not the scrollbar — it is that Radix keeps the viewport focusable and the bar operable, which a bare overflow container does not. A scrollable region whose contents are not themselves focusable is unreachable by keyboard: there is nothing to Tab to, so everything past the fold does not exist without a mouse.

For a page-level or prose scroll, the scroll-slim utility is lighter and needs no component. This is for a bounded panel: a long option list, a log, a sidebar that outgrows its column.

Props

ScrollArea props
PropTypeDefaultDescription
labelrequiredstringNames the region. Required, and not decoration: a scroll container is a keyboard stop, and an unnamed stop announces "group" and nothing else.
orientation'vertical' | 'horizontal' | 'both''vertical'

Also accepts everything in ComponentProps<typeof ScrollAreaPrimitive.Root>. Those are forwarded to the underlying element and are not listed row by row.

Keyboard

ScrollArea keyboard interactions
KeyDoes
TabMoves focus into the region, which is what makes it scrollable at all without a mouse.
Page UpPage DownScrolls it.

Accessibility

  • The viewport stays focusable. A scrollable region whose contents are not focusable has nothing to Tab to, so everything past the fold does not exist without a mouse.
  • label is required, because an unnamed keyboard stop announces "group" and nothing else.