Demos

A fixed-height list of biomarkers that scrolls inside its border.

Usage

Use a scroll area when a list must fit a fixed space, such as a sidebar or a panel inside a card. Let the page scroll when it can. Nested scrolling is harder to use, especially on touch.

Import it from @workspace/ui/components/scroll-area.

Anatomy

  • ScrollArea — The root and viewport. Adds a vertical scrollbar.
  • ScrollBar — Add one with orientation="horizontal" for sideways scrolling.

Notes

  • Give the scroll area a fixed height or width, or it grows with its content and never scrolls.
  • The viewport is focusable so keyboard users can scroll it.

Examples

Horizontal

Add a ScrollBar with orientation="horizontal" for content that scrolls sideways.

Props

These are the props you set most often. Unlisted props pass through to the underlying element.

ScrollArea

PropTypeDefaultDescription
classNamestring—Classes merged onto the root. Set the size here.

ScrollBar

PropTypeDefaultDescription
orientation"vertical" or "horizontal"verticalDirection of the scrollbar.