cosmic::iced_widget

Function keyed_column

source
pub fn keyed_column<'a, Key, Message, Theme, Renderer>(
    children: impl IntoIterator<Item = (Key, Element<'a, Message, Theme, Renderer>)>,
) -> Column<'a, Key, Message, Theme, Renderer>
where Key: Copy + PartialEq, Renderer: Renderer,
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) -> Element<'_, Message> {
    keyed_column((0..=100).map(|i| {
        (i, text!("Item {i}").into())
    })).into()
}