Expand description
List Item Module - Composable list items
This module provides a flexible list item system with composable content:
ListItem- The main container widgetListItemContent- Trait for custom content typesLabelContent- Simple text with optional iconPropertyContent- Key-value pair displayButtonContent- Clickable button content
§Usage
use egui::Color32;
use egui_charts::icons::icons;
use egui_charts::ui_kit::list_item::{ButtonContent, LabelContent, ListItem, PropertyContent};
// Simple label
let response = ListItem::new()
.selected(is_selected)
.show(ui, LabelContent::new("My Item"));
// Label with icon
let response = ListItem::new()
.show(ui, LabelContent::new("Settings").with_icon(&icons::SETTINGS));
// Key-value property
let response = ListItem::new()
.show(ui, PropertyContent::new("Price", "$1,234.56")
.value_color(Color32::GREEN));
// Action button
if ListItem::new()
.show(ui, ButtonContent::new(&icons::PLUS, "Add Item").primary())
.clicked()
{
// add the item
}Structs§
- Button
Content - Clickable button content for list items
- Content
Context - Context provided to ListItemContent implementations when rendering
- Label
Content - Simple text content with optional icon
- List
Item - Reference to ListItem configuration (forward declaration)
- List
Visuals - Visual state information for list items with color computation methods
- Property
Content - Key-value pair content for displaying properties
Enums§
- Button
Style - Button style variants
Traits§
- List
Item Content - Trait for types that can be rendered as list item content
Functions§
- simple_
list - Create a simple list of items