Skip to Content
ComponentsScrollArea

ScrollArea

ScrollArea hides native scrollbars and renders Windows 98 scrollbar chrome around overflowing content. Both vertical and horizontal scrollbars appear automatically when content overflows.

ScrollAreaLegacy is an older imperative-DOM variant that creates scrollbar elements directly. Prefer ScrollArea for new code.

Props

ExportKey propsDescription
ScrollAreaclassName, div propsDeclarative compound component with observer-based scrollbar sync.
ScrollAreaLegacyclassName, div propsImperative DOM variant using useScrollbar internally. Provided for backward compatibility.

Examples

Scrollable list

  • Item 01
  • Item 02
  • Item 03
  • Item 04
  • Item 05
  • Item 06
  • Item 07
  • Item 08
  • Item 09
  • Item 10
  • Item 11
  • Item 12
  • Item 13
  • Item 14
  • Item 15
  • Item 16
  • Item 17
  • Item 18

ARIA

ScrollArea keeps the content in normal DOM order. Add roles and labels to the content when needed.

Keyboard

ScrollArea does not make the frame focusable. Keyboard scrolling depends on the focusable content you place inside it.

SSR

Scrollbars are measured after mount. Give the root a stable width and height to avoid layout shifts.

Last updated on