Skip to main content

lazy_row

Function lazy_row 

Source
pub fn lazy_row() -> LazyRowBuilder
Expand description

§lazy_row

A horizontally scrolling list that only renders items visible in the viewport.

§Usage

Display a long, horizontal list of items, such as a gallery or a set of chips.

§Parameters

  • modifier — optional modifier for the scroll container.
  • cross_axis_alignment — how items align along the cross axis.
  • item_spacing — gap between successive items.
  • overscan — number of extra items instantiated before and after the viewport.
  • estimated_item_size — estimated main-axis size used before real measurements exist.
  • content_padding — symmetric padding around the lazy list content.
  • max_viewport_main — optional maximum viewport length, also limiting initial item construction before the viewport is measured.
  • scroll_smoothing — fraction of the remaining distance kept per 60Hz frame while animating a scroll step; defaults to the scrollable default.
  • scrollbar_behavior — scrollbar visibility; visible by default.
  • controller — optional external controller for scroll position and cache.
  • viewport_controller — optional shared controller for the actual scroll viewport.
  • keep_composed_items — retain visited item state until this list unmounts; hidden items are unplaced, except the active focused item kept for reveal.
  • item declarations are appended through builder methods like item, items, and sticky_header.

§Examples

use tessera_components::{lazy_list::lazy_row, text::text};
use tessera_ui::tessera;

#[tessera]
fn demo() {
    lazy_row().items(100, |i| {
        let text_content = format!("Item {i}");
        text(text_content);
    });
}