Skip to main content

keyed_column

Function keyed_column 

Source
pub fn keyed_column<Key, W>(
    children: impl IntoIterator<Item = (Key, W)>,
) -> Column<Key, W>
where Key: Copy + PartialEq, W: Meta,
Expand description

Creates a new keyed::Column from an iterator of elements.

Keyed columns distribute content vertically while keeping continuity.

ยงExample

use iced::widget::{keyed_column, text};

enum Message {
    // ...
}

fn view(state: &State) -> impl Widget<Message> {
    keyed_column((0..=100).map(|i| {
        (i, text!("Item {i}"))
    }))
}