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 listListItem- Item within a basic listActionList- List of actions (buttons, dropdowns)DataList- Flexible list for displaying structured dataDescriptionList- Key-value pair list with terms and descriptionsSimpleList- 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:
-
ClassesClassDescriptionAn action list is a group of actions, controls, or buttons with set spacing.A data list is used to display large data sets when you need a flexible layout or need to include interactive content like charts.A description list contains terms and their corresponding descriptions.A list component embeds a formatted list (bulleted or numbered list) into page content.A simple list provides a list of selectable items that can be shown within a page.