Scroll Container

A viewport with scrollbar hosting.

Basic use

SDK · integration snippet
use xgpui_luma::controls::scroll_container::ScrollContainer;
use xgpui_luma::controls::scrollbar::default_scrollbar_template;

let viewport = ScrollContainer::new("content", default_scrollbar_template(), cx);

Integration snippet, checked against the current SDK and Radix crates. cx is the initialized owner context. Keep spawned entities and subscriptions in the owning view.

Radix scrollbar styling

This utility does not require a dedicated Look builder. Pass xgpui_luma_look_radix::scrollbar_template(&look) to its constructor for visible Radix scrollbar chrome. Input routing, scrolling, visibility, and auto-hide stay in the SDK. See Scrollbar styling.

SDK behavior & customization

Compose content and scrollbar placement while retaining viewport state.

Use the module’s template contract for structural changes. Builder modifiers and item templates vary by control.

Application interaction

Scroll Container does not expose its own semantic event enum. Child controls keep their events; use the scrollbar or viewport integration for scroll changes.

Source

SDK module