Skip to main content

Scroll Area

A native scroll container with custom scrollbars.

Features

Installation

typo3 ui:add scroll-area

Read more about installing Components and Primitives.

Examples

Horizontal Scroll

Enable horizontal scrolling for wide content.

Both Directions

Support scrolling in both vertical and horizontal directions.

API Reference

The following tables cover the available props of the Fluid Primitives. For a full list of available client side props and methods, see the Zag.js Machine API.

scrollArea.root

Provides the scroll area container and shared state. Renders a <div> element.

scrollArea.viewport

Provides the native scrollable viewport. Renders a <div> element.

scrollArea.content

Wraps the scrollable content to measure its size. Renders a <div> element.

scrollArea.scrollbar

Displays a custom scrollbar track. Renders a <div> element.

NameDescriptionRequiredDefault
orientationEnum\Orientation
The orientation of the scrollbar.
No
Vertical

scrollArea.thumb

Displays the draggable scrollbar thumb. Renders a <div> element.

Anatomy

<primitives:scrollArea.root>
    <primitives:scrollArea.viewport>
        <primitives:scrollArea.content />
    </primitives:scrollArea.viewport>
    <primitives:scrollArea.scrollbar>
        <primitives:scrollArea.thumb />
    </primitives:scrollArea.scrollbar>
</primitives:scrollArea.root>