Skip to content

Conversation

@joshblack
Copy link
Member

Closes https://github.com/github/primer/issues/5289

Add support for leadingVisual to UnderlineNav.Item and update existing references for icon to leadingVisual.

Changelog

New

  • Add support for leadingVisual to UnderlineNav.Item with the React.ReactElement type

Changed

  • Deprecate the icon prop in favor of leadingVisual

Removed

Rollout strategy

  • Minor release

Copilot AI review requested due to automatic review settings November 17, 2025 16:01
@joshblack joshblack requested a review from a team as a code owner November 17, 2025 16:01
@joshblack joshblack requested a review from hectahertz November 17, 2025 16:01
@changeset-bot
Copy link

changeset-bot bot commented Nov 17, 2025

🦋 Changeset detected

Latest commit: 47ebc3b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 17, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

Copilot finished reviewing on behalf of joshblack November 17, 2025 16:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the leadingVisual prop to UnderlineNav.Item while deprecating the existing icon prop, aligning the component with Primer's design system conventions used in other components.

Key Changes:

  • Introduces leadingVisual prop accepting React.ReactElement as the new API for rendering visuals before item text
  • Deprecates the icon prop with a clear migration path to leadingVisual
  • Updates all internal usages across tests and stories from function components to JSX elements

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/src/UnderlineNav/UnderlineNavItem.tsx Adds leadingVisual prop, marks icon as deprecated, implements backwards-compatible fallback logic
packages/react/src/UnderlineNav/UnderlineNav.test.tsx Updates test data types from FC<IconProps> to React.ReactElement, adds backwards compatibility test for deprecated icon prop
packages/react/src/UnderlineNav/UnderlineNav.features.stories.tsx Migrates story examples from icon to leadingVisual, updates data types to use React elements
packages/react/src/UnderlineNav/UnderlineNav.examples.stories.tsx Migrates examples from icon to leadingVisual, removes unused Octicon wrapper, updates data types
packages/react/src/UnderlineNav/UnderlineNav.docs.json Adds documentation for leadingVisual prop and marks icon as deprecated
.changeset/old-yaks-win.md Documents the minor version change for the new feature

@github-actions github-actions bot temporarily deployed to storybook-preview-7200 November 17, 2025 16:11 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-7200 November 17, 2025 16:23 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7200 November 17, 2025 22:10 Inactive
Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

Makes sense!

completely optional, i know you have other work as well: Would love to see a eslint rule to go with it!

@joshblack
Copy link
Member Author

@siddharthkp good point, I made an issue for this over at: https://github.com/github/primer/issues/6144 to see if we could add support for repurposing the no-deprecated-props rule 👀

@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/7243

@github-actions github-actions bot temporarily deployed to storybook-preview-7200 November 19, 2025 17:46 Inactive
@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 19, 2025
@primer-integration
Copy link

🟢 ci completed with status success.

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 19, 2025
@github-actions
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@joshblack joshblack enabled auto-merge November 19, 2025 18:15
@joshblack joshblack added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit 0a0c2a0 Nov 19, 2025
49 checks passed
@joshblack joshblack deleted the feat/add-leading-visual-to-underline-nav branch November 19, 2025 18:28
@primer primer bot mentioned this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants