//! # Proxmox Widget Toolkit (for Yew)
//!
//! This toolkit provides Yew components to build Single Page
-//! Apps. It provides evertything you need to build complex user
+//! Apps. It provides everything you need to build complex user
//! interfaces:
//!
//! - Basic layout widgets like [Row](widget::Row) and [Column](widget::Column) (using css flexbox).
//! - Standard widgets like buttons, menus, toolbars, tooltips, tab panels,
//! - Data table with virtual scroll, sorting, nested resizable headers, tree support ...
+//! - List widget with virtual scroll support.
//! - Helpers to build complex forms easily ([widget::form])
//! - Modal dialogs
//! - Split pane with a draggable sparator.
//! the most complex widget. It is able to display tables and trees, and
//! has virtual scroll support.
+//! ### Lists
+//!
+//! The [List](widget::List) widget also supports virtual scrolling, and allows
+//! using a html grid column layout.
+
//! ### Drawing Canvas
//!
//! The [Canvas](widget::canvas) component utilizes the Html `<svg>` element to
#[prop_or_default]
pub key: Option<Key>,
+ /// The list uses a html grid layout, and you can set the 'grid-template-columns' property.
+ ///
+ /// This is a convenient way to use a column layout.
+ ///
+ /// ```
+ /// # use pwt::prelude::*;
+ /// # use pwt::widget::{List, ListTile};
+ /// # fn create_list_tile() -> List {
+ /// List::new(100, |pos| {
+ /// ListTile::new()
+ /// .with_child(html!{<span>{format!("{pos}")}</span>})
+ /// .with_child(html!{<span>{"A simple list tile"}</span>})
+ /// })
+ /// // Use a two column layout.
+ /// .grid_template_columns("auto 1fr")
+ /// # }
+ /// ```
+ ///
+ /// see: <https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns>
#[prop_or(AttrValue::Static("1fr"))]
#[builder(IntoPropValue, into_prop_value)]
pub grid_template_columns: AttrValue,
}
}
+#[doc(hidden)]
pub struct PwtList {
viewport_height: f64,
viewport_width: f64,