Package org.patternfly.component.list


package org.patternfly.component.list
Provides list components for displaying collections of items in various formats.

This package contains several list components: basic lists (List), action lists (ActionList), data lists (DataList), description lists (DescriptionList), and simple lists (SimpleList). Each list type serves a different purpose, from simple unordered lists to complex data display with expandable content and actions.

Components

  • List - Basic unordered or ordered list
  • ListItem - Item within a basic list
  • ActionList - List of actions (buttons, dropdowns)
  • DataList - Flexible list for displaying structured data
  • DescriptionList - Key-value pair list with terms and descriptions
  • SimpleList - Selectable list with grouped items

Usage

Basic lists with different styles:

import static org.jboss.elemento.Elements.ol;
import static org.patternfly.component.list.List.list;
import static org.patternfly.component.list.ListItem.listItem;
import static org.patternfly.icon.IconSets.fas.bookOpen;
import static org.patternfly.icon.IconSets.fas.desktop;

// Basic unordered list
List basicList = list()
        .addItem(listItem("item-0").text("First"))
        .addItem(listItem("item-1").text("Second"))
        .addItem(listItem("item-2").text("Third"));

// Ordered list
List orderedList = list(ol())
        .addItem(listItem("item-0").text("First"))
        .addItem(listItem("item-1").text("Second"))
        .addItem(listItem("item-2").text("Third"));

// Plain list with icons
List iconList = list().plain()
        .addItem(listItem("item-0").text("Books").icon(bookOpen()))
        .addItem(listItem("item-1").text("Computers").icon(desktop()));

// Inline list
List inlineList = list().inline()
        .addItem(listItem("item-0").text("First"))
        .addItem(listItem("item-1").text("Second"));
See Also: