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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/react/src/Button/Button.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
"type": "React.ElementType",
"defaultValue": "'button'"
},
{
"name": "href",
"type": "string",
"description": "**May only be used when `as` is set to 'a'**.\n The URL the button links to. If `as` is set to 'a', this prop is required."
},
{
"name": "block",
"type": "boolean",
Expand Down Expand Up @@ -190,4 +195,4 @@
"element": "button",
"url": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attributes"
}
}
}
12 changes: 11 additions & 1 deletion packages/react/src/Button/IconButton.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
"required": true,
"description": "This will be the Button description."
},
{
"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.

},
{
"name": "href",
"type": "string",
"description": "**May only be used when `as` is set to 'a'**.\n The URL the button links to. If `as` is set to 'a', this prop is required."
},
{
"name": "variant",
"type": "'default' | 'primary' | 'danger' | 'invisible' | 'link'",
Expand Down Expand Up @@ -124,4 +134,4 @@
}
],
"subcomponents": []
}
}
Loading