Skip to content

Conversation

@gaambo
Copy link
Contributor

@gaambo gaambo commented Apr 5, 2024

What?

Adds better explanation on when to use a PanelRow component and when not.

Why?

In #41671 it was mentioned (comment), that using a PanelRow for single components is not necessary / may have side-effects. For example some inputs may not render as expected, since they are flex-children. For my self, the documentation suggested, that the structure should always be Panel > PanelBody > PanelRow. I think it may make sense, to explicitly state, that using a PanelRow is not necessary.

Here's a screenshot showing the difference:

PanelRow is a flex-child and adds margin-top.
gb-panel-rows

Open Questions

The markdown file in question has some linting errors: missing image alt texts and especially duplicate heading ids. Is there a rule on how to avoid duplicate heading ids if the headings are the same (Usage)?

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@gaambo gaambo requested a review from ajitbohra as a code owner April 5, 2024 14:10
@github-actions
Copy link

github-actions bot commented Apr 5, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: gaambo <[email protected]>
Co-authored-by: skorasaurus <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@skorasaurus
Copy link
Member

Looks good to me although would appreciate someone with more knowledge to approve this.

@t-hamano t-hamano added the [Package] Components /packages/components label Nov 6, 2024
@mirka mirka requested a review from a team November 12, 2024 21:04

The `Panel` creates a container with a header that can take collapsible `PanelBody` components to easily create a user friendly interface for affecting state and attributes.

A `PanelRow` is only necessary when you want to wrap multiple components in a row. With only one component, there is no difference in wrapping it in a `PanelRow` or not.
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to put this where the rest of the PanelRow documentation is (a few paragraphs down, basically)?

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

Labels

[Package] Components /packages/components [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants