Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(TreeView): add example with unique icon per item #11377

Merged

Conversation

adamviktora
Copy link
Contributor

Closes #10236

@patternfly-build
Copy link
Contributor

patternfly-build commented Jan 6, 2025

@adamviktora adamviktora requested review from a team, wise-king-sullyman and mfrances17 and removed request for a team January 6, 2025 16:15
Copy link
Contributor

@mfrances17 mfrances17 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

name: 'Github accounts',
id: 'iconPerItem-Github',
icon: <GithubIcon />,
expandedIcon: <GithubIcon />,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since these icons are the same, we could omit the expandedIcon prop and the default icon will be retained. Having this in the example may lead consumers to think that you have to pass both props even if the icon doesn't change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I initially thought it might be a good idea to show customers that "hey, you can also customize the expanded icon prop if you want". But you are right that it is rather misleading.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah that might be good, possibly one of the parent items retains that folder icon from the previous example to show the default and expanded icon. If you would want to do something like that that'd be good to me, but as-is this looks good

@wise-king-sullyman wise-king-sullyman merged commit 6733ef5 into patternfly:main Jan 20, 2025
13 checks passed
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.

Tree view - ability to specify icon per each element
5 participants