row

Function row 

Source
pub fn row<F>(args: RowArgs, scope_config: F)
where F: FnOnce(&mut RowScope<'_>),
Expand description

§row

A layout component that arranges its children in a horizontal row.

§Usage

Stack components horizontally, with options for alignment and flexible spacing.

§Parameters

  • args — configures the row’s dimensions and alignment; see RowArgs.
  • scope_config — a closure that receives a RowScope for adding children.

§Examples

use tessera_ui_basic_components::{
    row::{row, RowArgs},
    text::{text, TextArgsBuilder},
    spacer::{spacer, SpacerArgs},
};

row(RowArgs::default(), |scope| {
    scope.child(|| text(TextArgsBuilder::default().text("First".to_string()).build().expect("builder construction failed")));
    scope.child_weighted(|| spacer(SpacerArgs::default()), 1.0); // Flexible space
    scope.child(|| text(TextArgsBuilder::default().text("Last".to_string()).build().expect("builder construction failed")));
});