From 424f22e5de127a8e07a3b1e0266bee26ffe1d28a Mon Sep 17 00:00:00 2001 From: Riddhi Bansal <41935566+riddhybansal@users.noreply.github.com> Date: Tue, 7 Jan 2025 03:43:49 +0530 Subject: [PATCH] fix: added href to iconButton (#18283) * fix: added href to iconButton * fix: updated snapshots * fix: comment * Update packages/react/src/components/IconButton/index.tsx --------- Co-authored-by: Gururaj J <89023023+Gururajj77@users.noreply.github.com> Co-authored-by: Taylor Jones --- .../__tests__/__snapshots__/PublicAPI-test.js.snap | 3 +++ packages/react/src/components/IconButton/index.tsx | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 897b767d57de..4d384ca84c66 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -4226,6 +4226,9 @@ Map { "enterDelayMs": Object { "type": "number", }, + "href": Object { + "type": "string", + }, "isSelected": Object { "type": "bool", }, diff --git a/packages/react/src/components/IconButton/index.tsx b/packages/react/src/components/IconButton/index.tsx index 224d757e40db..9d1d77756e94 100644 --- a/packages/react/src/components/IconButton/index.tsx +++ b/packages/react/src/components/IconButton/index.tsx @@ -77,6 +77,11 @@ interface IconButtonProps */ autoAlign?: boolean; + /** + * Optionally specify an href for your IconButton to become an `` element + */ + href?: string; + /** * Provide an icon or asset to be rendered inside of the IconButton */ @@ -253,6 +258,11 @@ IconButton.propTypes = { */ autoAlign: PropTypes.bool, + /** + * Optionally specify an href for your IconButton to become an `` element + */ + href: PropTypes.string, + /** * Provide an icon or asset to be rendered inside of the IconButton */