Skip to content

Panel: Recommend CollapsibleCard for use outside the block inspector#78863

Merged
Mamaduka merged 3 commits into
WordPress:trunkfrom
Mayank-Tripathi32:add/panel-collapsiblecard-doc-note
Jun 13, 2026
Merged

Panel: Recommend CollapsibleCard for use outside the block inspector#78863
Mamaduka merged 3 commits into
WordPress:trunkfrom
Mayank-Tripathi32:add/panel-collapsiblecard-doc-note

Conversation

@Mayank-Tripathi32

@Mayank-Tripathi32 Mayank-Tripathi32 commented Jun 1, 2026

Copy link
Copy Markdown
Member

closes #26867

What?

Adds a documentation note to Panel recommending CollapsibleCard for collapsible sections used outside the block inspector.

Why?

Follow-up to #78752. Rather than extending the Panel family with a headingLevel prop, the discussion concluded that Panel is intended for the block inspector sidebar, and CollapsibleCard should be used elsewhere. This documents that guidance.

How?

  • Added a note under the Panel README's Development guidelines pointing to CollapsibleCard.

Testing Instructions

  • Confirm the rendered Panel README shows the recommendation note linking to the CollapsibleCard Storybook docs.
  • Confirm that it is added in correct location for docs.

Use of AI?

  • Yes, Claude

@Mayank-Tripathi32 Mayank-Tripathi32 requested review from a team and ajitbohra as code owners June 1, 2026 18:14
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

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: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: johnwatkins0 <johnwatkins0@git.wordpress.org>

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

@github-actions github-actions Bot added the [Package] Components /packages/components label Jun 1, 2026
@aduth

aduth commented Jun 4, 2026

Copy link
Copy Markdown
Member

I notice that we recommend this "globally":

componentStatus: {
status: 'recommended',
whereUsed: 'global',
},

If what we're saying here and discussed in #26867 is that this component is primarily intended to be used in the editor, then I would suggest we update 'global' to 'editor' to reflect this.

Could you make this update? And remove tags: [ 'manifest' ] as well. For context why this matters, the manifest tag and whereUsed: 'global' are what indicate which components are part of the design system (as discussed in #77159 (comment)). And it sounds like what we concluded in the previous pull request is that this is an editor component, not a general-purpose design system component. CollapsibleCard is already recommended, so no changes are needed there.

@aduth aduth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could might be a good use-case for componentStatus.notes in the Storybook, which is often used for this kind of "you might want to use a different component instead in some situations" type guidance.

Comment thread packages/components/src/panel/README.md Outdated
Comment on lines +53 to +54
> **Note:** The `Panel` family is intended for the block inspector sidebar. For collapsible sections elsewhere, use the [`CollapsibleCard`](https://wordpress.github.io/gutenberg/?path=/docs/design-system-components-collapsiblecard--docs) component instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd suggest moving this up higher, maybe even as a plain paragraph under the introduction "Panels expand and collapse multiple sections of content". I'd also suggest removing the > blockquote, since we're not quoting anything.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure.

@aduth aduth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@Mamaduka

Copy link
Copy Markdown
Member

Thanks for the follow-up, @Mayank-Tripathi32! I think this doesn't require a changelog entry; changes are visible in Storybook and the docs.

@Mamaduka Mamaduka added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Jun 13, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Jun 13, 2026
@Mamaduka Mamaduka merged commit 20e0435 into WordPress:trunk Jun 13, 2026
47 of 48 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 13, 2026
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.

Allow PanelBody title heading size to be configurable

3 participants