Skip to Content
WidgetsScrollView

ScrollView

ScrollView is a viewport over a single child.

ScrollView
ScrollView terminal preview
Terminal preview of ScrollView

Smallest example

let transcript = ScrollView::new() .offset(self.offset) .on_scroll(Message::ScrollTo) .layout(Layout { width: Length::Fill, height: Length::Fixed(4) }) .child(Paragraph::new(self.log.clone()).build()) .build();

Use ScrollView when

  • one child may become taller than the viewport
  • the scroll offset is part of your app state or runtime continuity
  • you want to pair content with a Scrollbar

Key builder methods

  • ScrollView::new()
  • .offset(...)
  • .follow_bottom(...)
  • .on_scroll(...)
  • .child(...)

Common pairing

The most common pairing is:

  • ScrollView for the content viewport
  • Scrollbar for visual position
  • one shared offset in state

Where to see it in examples

Last updated on