class RatatuiRuby::Widgets::ListItem

A styled list item combining content with optional style.

By default, List items are strings. For more control over styling individual rows, wrap the content in a ListItem to apply a style specific to that item.

The content can be a String, Text::Span, or Text::Line. The style applies to the entire row background.

Examples

# Item with red background
ListItem.new(content: "Error", style: Style.new(bg: :red))

# Item with styled content
ListItem.new(
  content: Text::Span.new(content: "Status: OK", style: Style.new(fg: :green, modifiers: [:bold]))
)