Skip to content

Commit

Permalink
fix(IconButton): dynamic size prop
Browse files Browse the repository at this point in the history
  • Loading branch information
sstrubberg committed Jan 4, 2022
1 parent 6f7154a commit f58d832
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react/src/components/IconButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const IconButton = React.forwardRef(function IconButton(props, ref) {
kind,
label,
leaveDelayMs,
size = 'md',
...rest
} = props;
const prefix = usePrefix();
Expand All @@ -32,7 +33,7 @@ const IconButton = React.forwardRef(function IconButton(props, ref) {
enterDelayMs={enterDelayMs}
label={label}
leaveDelayMs={leaveDelayMs}>
<Button {...rest} hasIconOnly kind={kind} ref={ref} size="sm">
<Button {...rest} hasIconOnly kind={kind} ref={ref} size={size}>
{children}
</Button>
</Tooltip>
Expand Down Expand Up @@ -86,6 +87,11 @@ IconButton.propTypes = {
* Specify the duration in milliseconds to delay before hiding the tooltip
*/
leaveDelayMs: PropTypes.number,

/**
* Specify the duration in milliseconds to delay before hiding the tooltip
*/
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
};

export { IconButton };

0 comments on commit f58d832

Please sign in to comment.