Skip to content

Conversation

@manzoorwanijk
Copy link
Member

@manzoorwanijk manzoorwanijk commented Nov 20, 2025

What?

Closes #73458

Why?

As mentioned in the linked issue, sometimes we want to render the link in places where we don't need/want the icon to be shown. That use-case is not possible with the current version of the component.

How?

  • Add an optional prop withoutIcon to the ExternalLink component to allow rendering the link without the icon
  • Update the story to better reflect the rendering of the link inline with other text

Testing Instructions

  • Run npm run storybook:dev
  • Go to Components > Navigation > ExternalLink
  • Toggle the withoutIcon prop to see the behavior

Testing Instructions for Keyboard

Screenshots or screencast

  • With icons (default)
    image
  • Without icon
    image

@manzoorwanijk manzoorwanijk self-assigned this Nov 20, 2025
@manzoorwanijk manzoorwanijk added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Nov 20, 2025
@github-actions
Copy link

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: manzoorwanijk <[email protected]>

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

Copy link

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 a withoutIcon prop to the ExternalLink component, allowing developers to render external links without the visual external link icon (↗ or ↖) when it's not desired or appropriate for the design context.

  • Added optional withoutIcon boolean prop to control icon visibility
  • Updated Storybook stories to demonstrate both default and without-icon variants
  • Enhanced story template to show inline usage with surrounding text

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/components/src/external-link/types.ts Added withoutIcon optional boolean prop definition with documentation
packages/components/src/external-link/index.tsx Implemented conditional rendering of the external link icon based on the new prop
packages/components/src/external-link/stories/index.story.tsx Updated story template to show inline usage and added WithoutIcon story variant
packages/components/CHANGELOG.md Documented the enhancement in the changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@manzoorwanijk
Copy link
Member Author

Addressed the concern raised by Copilot

Screen.Recording.2025-11-20.at.1.03.05.PM.mov

@github-actions
Copy link

Flaky tests detected in 865a4c3.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19529217855
📝 Reported issues:

@manzoorwanijk
Copy link
Member Author

As mentioned in the linked issue, this one is more like a convenience than a feature.

@manzoorwanijk manzoorwanijk deleted the update/components/allow-external-link-without-icon branch November 21, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ExternalLink: Allow hiding the icon

2 participants