Skip to content

Adds 'as' and 'href' to Button+IconButton prop docs #6361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2025

Conversation

mperrotti
Copy link
Contributor

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

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

This is just a docs update - not actually a change to the package.

Testing & Reviewing

Merge checklist

@Copilot Copilot AI review requested due to automatic review settings July 22, 2025 18:37
@mperrotti mperrotti requested a review from a team as a code owner July 22, 2025 18:37
@mperrotti mperrotti requested a review from pksjce July 22, 2025 18:37
Copy link

changeset-bot bot commented Jul 22, 2025

⚠️ No Changeset found

Latest commit: 9100956

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

Copy link
Contributor

@Copilot 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 documentation for the as and href props to both Button and IconButton components to address missing prop documentation. The changes ensure that developers have proper documentation for these existing props that allow buttons to be rendered as anchor elements.

  • Adds as prop documentation to IconButton showing it accepts React.ElementType with default value 'button'
  • Adds href prop documentation to both Button and IconButton with clear usage constraints
  • Documents the relationship between as and href props with proper validation requirements

Reviewed Changes

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

File Description
packages/react/src/Button/IconButton.docs.json Adds documentation for both as and href props
packages/react/src/Button/Button.docs.json Adds documentation for href prop (as prop already existed)

{
"name": "as",
"type": "React.ElementType",
"defaultValue": "'button'"
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

Consider adding a description for the 'as' prop to explain its purpose, similar to how other props in the documentation include descriptions.

Suggested change
"defaultValue": "'button'"
"defaultValue": "'button'",
"description": "Specifies the HTML element or custom component to render. For example, set `as` to 'a' to render an anchor tag instead of a button."

Copilot uses AI. Check for mistakes.

@mperrotti mperrotti added the skip changeset This change does not need a changelog label Jul 22, 2025
Copy link
Contributor

github-actions bot commented Jul 22, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.2 KB (0%)
packages/react/dist/browser.umd.js 92.55 KB (0%)

@mperrotti mperrotti enabled auto-merge July 28, 2025 14:34
@mperrotti mperrotti added this pull request to the merge queue Jul 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 28, 2025
@mperrotti mperrotti added this pull request to the merge queue Jul 29, 2025
Merged via the queue into main with commit 68a9f53 Jul 29, 2025
43 checks passed
@mperrotti mperrotti deleted the mp/button-prop-docs-as+href branch July 29, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants