Module defaultitem

Source
Expand description

Default item implementation and delegate for list components.

This module provides the standard item type and delegate implementation for the list component. The DefaultItem is a simple item with a title and description, while DefaultDelegate handles the rendering and interaction logic for these items.

§Default Item Structure

The DefaultItem represents a basic list item with:

  • A title (main text)
  • A description (secondary text, optional display)

§Default Delegate

The DefaultDelegate handles:

  • Rendering items with different visual states (normal, selected, dimmed)
  • Managing item height and spacing
  • Filtering and match highlighting (when implemented)

§Styling

The DefaultItemStyles provides comprehensive styling options:

  • Normal state styles for title and description
  • Selected state styles with borders and highlighting
  • Dimmed state styles for filtered-out items
  • Filter match highlighting styles

§Example

use bubbletea_widgets::list::{DefaultItem, DefaultDelegate};

let item = DefaultItem::new("Task 1", "Complete the documentation");
let delegate = DefaultDelegate::new();

Structs§

DefaultDelegate
A delegate for rendering DefaultItem instances in list components.
DefaultItem
A simple list item with title and description text.
DefaultItemStyles
Styling configuration for default list items in various visual states.