Skip to content

Commit fecf0f2

Browse files
authored
💄 Allow passing icon props to IconButton (#1288)
1 parent 2276f65 commit fecf0f2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@equinor/amplify-component-lib",
3-
"version": "13.1.1",
3+
"version": "13.1.2",
44
"description": "Frontend Typescript components for the Amplify team",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/molecules/Button/IconButton/IconButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, ReactNode } from 'react';
22

3-
import { Icon } from '@equinor/eds-core-react';
3+
import { Icon, IconProps } from '@equinor/eds-core-react';
44
import { CircularProgressProps } from '@equinor/eds-core-react';
55
import { IconData } from '@equinor/eds-icons';
66
import type {
@@ -21,6 +21,7 @@ type Shape = 'circular' | 'square';
2121

2222
type BaseIconButtonProps = {
2323
icon: IconData;
24+
iconProps?: Omit<IconProps, 'data'>;
2425
shape?: Shape;
2526
children?: never;
2627
} & Omit<CommonButtonProps, 'children'>;
@@ -32,6 +33,7 @@ const BaseIconButton: FC<BaseIconButtonProps> = ({
3233
loading = false,
3334
shape = 'circular',
3435
onClick,
36+
iconProps,
3537
...rest
3638
}) => {
3739
const tokens = TOKEN_MAPPINGS[color][variant];
@@ -62,7 +64,7 @@ const BaseIconButton: FC<BaseIconButtonProps> = ({
6264
/>
6365
</>
6466
) : (
65-
<Icon data={icon} />
67+
<Icon data={icon} {...iconProps} />
6668
)}
6769
</IconButtonWrapper>
6870
);

0 commit comments

Comments
 (0)