lazy_row

Function lazy_row 

Source
pub fn lazy_row<F>(args: LazyRowArgs, state: LazyListState, configure: F)
where F: FnOnce(&mut LazyRowScope<'_>),
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

  • args — configures the list’s layout and scrolling behavior; see LazyRowArgs.
  • state — a clonable LazyListState to manage scroll position and item measurement caching.
  • configure — a closure that receives a LazyRowScope for adding items to the list.

§Examples

use tessera_ui_basic_components::{
    lazy_list::{lazy_row, LazyRowArgs, LazyListState},
    text::{text, TextArgsBuilder},
};

let list_state = LazyListState::new();

lazy_row(LazyRowArgs::default(), list_state, |scope| {
    scope.items(100, |i| {
        let text_content = format!("Item {}", i);
        text(TextArgsBuilder::default().text(text_content).build().expect("builder construction failed"));
    });
});