Module column

Module column 

Source
Expand description

Provides a flexible vertical layout component for arranging child widgets in a single column.

This module defines the column component, which stacks its children vertically and offers fine-grained control over alignment, sizing, and flexible space distribution via weights. It is suitable for building user interfaces where elements need to be organized from top to bottom, such as forms, lists, or grouped controls.

Children are added declaratively within a scope closure, which provides methods to add children with or without weights.

§Example

use tessera_ui_basic_components::column::{column, ColumnArgs};
use tessera_ui_basic_components::text::text;
use tessera_ui_basic_components::spacer::{spacer, SpacerArgs};

column(ColumnArgs::default(), |scope| {
    scope.child(|| text("First item".to_string()));
    scope.child_weighted(|| spacer(SpacerArgs::default()), 1.0); // This spacer will be flexible
    scope.child(|| text("Last item".to_string()));
});

Structs§

ColumnArgs
Arguments for the column component.
ColumnArgsBuilder
Builder for ColumnArgs.
ColumnScope
A scope for declaratively adding children to a column component.

Enums§

ColumnArgsBuilderError
Error type for ColumnArgsBuilder

Functions§

column
A column component that arranges its children vertically.