Skip to content

Conversation

@dlabaj
Copy link
Contributor

@dlabaj dlabaj commented Oct 28, 2025

Adds tests to ensure the CardDescription component renders correctly with PatternFly Core styles, handles className, and spreads extra props to the root element.

@dlabaj dlabaj self-assigned this Oct 28, 2025
@dlabaj dlabaj requested review from kmcfaul and mcoker October 28, 2025 20:09
@patternfly-build
Copy link
Contributor

patternfly-build commented Oct 28, 2025

@dlabaj dlabaj changed the title Adds tests for CardDescription component Adds CardDescription component Oct 30, 2025
@kmcfaul kmcfaul linked an issue Nov 4, 2025 that may be closed by this pull request
Copy link
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This structure seems out of date with the core implementation

### Basic cards

Basic cards typically have a `<CardTitle>`, `<CardBody>` and `<CardFooter>`. You may omit these components as needed, but it is recommended to at least include a `<CardBody>` to provide details about the card item.
Basic cards typically have a `<CardTitle>`, `<CardSubtitle>`, `<CardBody>` and `<CardFooter>`. You may omit these components as needed, but it is recommended to at least include a `<CardBody>` to provide details about the card item.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we want to say that cards will typically have a subtitle, or should the subtitles be just somsthing that can be added but aren't usually there?

Copy link
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match the core structure, CardTitle needs a subtitle prop which passes the content and puts the cardSubtitle at a sibling level to the CardTitle's internal cardTitleText div. The current implementation is putting the cardSubtitle as a child of cardTitleText.

I think I would prefer making the subtitle prop represent only the ReactNode content and conditionally rendering the cardSubtitle div in CardTitle based on the prop, but I'd also be fine with keeping CardSubtitle as a component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Card - CardTitle description

4 participants