Skip to content

docs: prefer React elements for slot-based props - #8490

Merged
joshblack merged 5 commits into
mainfrom
copilot/update-style-guide-slot-based-props
Oct 14, 2026
Merged

joshblack merged 5 commits into
mainfrom
copilot/update-style-guide-slot-based-props

Conversation

Copilot AI commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codify the guidance from #8450: prefer React elements for slot-based props such as leadingVisual, trailingVisual, and icon, enabling composition across Server/Client Component boundaries.

Changelog

New

  • API guidance: Prefer elements over component types; distinguish ReactElement from ReactNode and reserve render props for state-dependent content.
  • Examples: Contrast component-type and element-based usage, preserving backwards compatibility for existing APIs.

Changed

  • Updated the style guide table of contents.

Removed

None.

Rollout strategy

  • None

Testing & Reviewing

Review the new Props guidance against #8450; no component APIs change.

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
@joshblack joshblack added the skip changeset This change does not need a changelog label Oct 5, 2026 — with Copilot SWE Agent
Copilot AI requested a review from joshblack October 5, 2026 15:07
Copilot AI added the skip changeset This change does not need a changelog label Oct 5, 2026
@changeset-bot

changeset-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f8526ed

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@joshblack joshblack 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.

@copilot instead of putting this in our style guide, put it in our style guide skill

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot instead of putting this in our style guide, put it in our style guide skill

Moved the guidance and examples into .github/skills/style-guide/SKILL.md and restored contributor-docs/style.md to its pre-PR state in 5e7f868. Formatting and Markdown lint passed.

Copilot AI requested a review from joshblack October 5, 2026 15:17

@joshblack joshblack 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.

@copilot update the style-guide skill to include instructions on how to update it. The skill itself should be minimal, with the table linking out to topics. When updating or adding to the skill, things should go under existing topics or new topics. This addition should be under a new topic for component prop types

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update the style-guide skill to include instructions on how to update it. The skill itself should be minimal, with the table linking out to topics. When updating or adding to the skill, thing...

Updated in ac37b2c: SKILL.md now has maintenance instructions and a table entry linking to docs/component-prop-types.md, which contains the slot-prop guidance and examples. Formatting and Markdown lint passed.

Copilot AI requested a review from joshblack October 5, 2026 15:23
@joshblack
joshblack marked this pull request as ready for review October 5, 2026 15:25
Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:25
@joshblack
joshblack requested a review from a team as a code owner October 5, 2026 15:25
@joshblack joshblack added the integration-tests: skipped manually Changes in this PR do not require an integration test label Oct 5, 2026
@joshblack
joshblack enabled auto-merge October 5, 2026 15:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The documentation is accurate, consistent with the referenced API direction, and requires no changeset.

Review effort: Balanced
Findings: None

What changed in this PR

Documents preferred React element usage for slot-based props, improving Server/Client Component interoperability without API changes.

Changes:

  • Adds prop-type guidance and examples.
  • Links the guidance from the style-guide index.
File Description
.github/​skills/​style-guide/​SKILL.md Adds the prop-types topic and maintenance guidance.
.github/​skills/​style-guide/​docs/​component-prop-types.md Documents element-based slot prop conventions.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@joshblack joshblack 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.

@copilot prefer React.ReactNode over React.ElementType since it makes it easier to use (for example, you can conditionally apply a leadingVisual with React.ReactNode but with ElementType you cannot)

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
auto-merge was automatically disabled October 6, 2026 15:17

Head branch was pushed to by a user without write access

Copilot AI commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot prefer React.ReactNode over React.ElementType since it makes it easier to use (for example, you can conditionally apply a leadingVisual with React.ReactNode but with ElementType you cannot)

Updated the style-guide topic to recommend React.ReactNode for slot props and show conditional visual content. Committed as f297618.

Copilot AI requested a review from joshblack October 6, 2026 15:18

@joshblack joshblack 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.

@copilot prefer React.ReactNode actually instead of React.ElementType. Also don't call out to the PR for this.

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot prefer React.ReactNode actually instead of React.ElementType. Also don't call out to the PR for this.

The topic now foregrounds React.ReactNode for slot props and no longer references the PR. Committed as f8526ed.

@joshblack
joshblack added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 2266948 Oct 14, 2026
56 checks passed
@joshblack
joshblack deleted the copilot/update-style-guide-slot-based-props branch October 14, 2026 16:12

This branch was successfully deployed

1 active and 1 inactive deployments
storybook-preview-8490 — f8526ed9 Deployed Oct 7, 2026 by github-actions[bot]
github-pages — f8526ed9 Deployed Oct 7, 2026 by Copilot via deploy-preview #33589
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants