From: Dietmar Maurer Date: Sat, 30 Nov 2024 08:39:33 +0000 (+0100) Subject: docs: improve list tile example X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=049bd9f6353551a7e95d74b97625474556464420;p=ui%2Fproxmox-yew-widget-toolkit.git docs: improve list tile example Signed-off-by: Dietmar Maurer --- diff --git a/src/widget/list_tile.rs b/src/widget/list_tile.rs index 9a595f5..7d9ec97 100644 --- a/src/widget/list_tile.rs +++ b/src/widget/list_tile.rs @@ -7,19 +7,24 @@ use crate::props::{ListenersWrapper, WidgetStdProps}; use pwt_macros::{builder, widget}; -/// List tile. A container with flex row layout. +/// List tile. A container with grid/subgrid layout. +/// +/// This is meant to be used inside [List]. /// /// ``` /// # use pwt::prelude::*; -/// # use pwt::widget::ListTile; -/// # fn create_list_tile() -> ListTile { -/// ListTile::new() -/// .with_child(html!{{"A simple list tile"}}) -/// .with_child(html!{{"second column"}}) -/// .interactive(true) -/// .disabled(false) -/// .style("justify-content", "space-between") -/// .class(pwt::css::ColorScheme::Primary) +/// # use pwt::widget::{List, ListTile}; +/// # fn create_list_tile() -> List { +/// List::new(100, |pos| { +/// ListTile::new() +/// .with_child(html!{{format!("{pos}")}}) +/// .with_child(html!{{"A simple list tile"}}) +/// .with_child(html!{{"third column"}}) +/// .interactive(true) +/// .disabled(false) +/// .class(pwt::css::ColorScheme::Primary) +/// }) +/// .grid_template_columns("auto 1fr auto") /// # } /// ``` #[widget(pwt=crate, @element, @container)]