Package org.patternfly.component.card
package org.patternfly.component.card
Provides the PatternFly card component and its subcomponents for displaying information in a contained, flexible layout.
An expandable card with header, actions, and expandable content:
A card is a square or rectangular container that can contain any kind of content. Cards symbolize units of information and allow users to interact with a collection of related information. Cards can be composed with a title, body, footer, header, and actions using the fluent builder API.
Usage
A basic card with title, body, and footer:import static org.patternfly.component.card.Card.card;
import static org.patternfly.component.card.CardBody.cardBody;
import static org.patternfly.component.card.CardFooter.cardFooter;
import static org.patternfly.component.card.CardTitle.cardTitle;
card()
.addTitle(cardTitle("Title"))
.addBody(cardBody().text("Body"))
.addFooter(cardFooter().text("Footer"));
import static org.patternfly.component.card.Card.card;
import static org.patternfly.component.card.CardBody.cardBody;
import static org.patternfly.component.card.CardExpandableContent.cardExpandableContent;
import static org.patternfly.component.card.CardFooter.cardFooter;
import static org.patternfly.component.card.CardHeader.cardHeader;
import static org.patternfly.component.card.CardTitle.cardTitle;
card().expandable()
.addHeader(cardHeader()
.addTitle(cardTitle("Title")))
.addExpandableContent(cardExpandableContent()
.addBody(cardBody().text("Body"))
.addFooter(cardFooter().text("Footer")));
- See Also:
-
ClassesClassDescriptionA card is a square or rectangular container that can contain any kind of content.The body section of a card, used to hold the main content.The expandable content section of a card that can be toggled via the card header.The footer section of a card, typically used for actions or supplementary information.The header section of a card, containing title, actions, and expandable toggle controls.The subtitle element of a card title, rendered below the title text.The title element of a card, rendered as a heading or plain text within the card or card header.