-
Notifications
You must be signed in to change notification settings - Fork 621
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
Conversation
|
There was a problem hiding this 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
andhref
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'" |
There was a problem hiding this comment.
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.
"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.
size-limit report 📦
|
Closes https://github.com/github/primer/issues/5469
Changelog
New
Changed
Removed
Rollout strategy
This is just a docs update - not actually a change to the package.
Testing & Reviewing
Merge checklist