Skip to content

Conversation

@georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Jan 30, 2026

Description

This PR aligns the ButtonIcon component implementations in both React and React Native with the Figma design specifications. The icon sizes were misaligned across all three size variants, and the React Native implementation had an incorrect border radius for non-floating states.

What is the reason for the change?
The ButtonIcon component was using incorrect icon sizes that didn't match the Figma design. For example, ButtonIcon.Md was using Icon.Md (20px) when it should have been using Icon.Lg (24px) according to the Figma layers.

What is the improvement/solution?

  • Updated icon size mapping to match Figma specifications for all three size variants
  • Fixed React Native border radius to match the 4px specified in Figma (was 2px)
  • Updated tests to reflect the border radius change

Changes:

  • ButtonIcon.Sm now uses Icon.Md (20px instead of 16px)
  • ButtonIcon.Md now uses Icon.Lg (24px instead of 20px)
  • ButtonIcon.Lg now uses Icon.Xl (32px instead of 24px)
  • React Native non-floating border radius: 2px → 4px

Related issues

Fixes: N/A (design alignment with Figma)

Manual testing steps

  1. View ButtonIcon components in Storybook for both React and React Native
  2. Compare icon sizes in all three size variants (Sm, Md, Lg) with Figma design
  3. Verify border radius matches Figma (4px for non-floating, fully rounded for floating)
  4. Test all states: default, hover, pressed, disabled, floating, inverse

Screenshots/Recordings

Before

Icon sizes were smaller than designed:

  • Sm: 16px icon (should be 20px)
  • Md: 20px icon (should be 24px)
  • Lg: 24px icon (should be 32px)

React Native had 2px border radius (should be 4px)

beforemobile720.mov
before720.mov

After

Icon sizes match Figma:

  • Sm: 20px icon ✓
  • Md: 24px icon ✓
  • Lg: 32px icon ✓
  • border radius: 8px ✓
mobileafter720.mov
after720.mov

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable
  • I've documented my code using JSDoc format if applicable
  • I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Changes shared ButtonIcon visuals (icon size mapping and non-floating corner radius) in both React and React Native, which can cause widespread UI/layout diffs in consuming apps. No security or data-handling logic is affected.

Overview
Updates ButtonIcon in both design-system-react and design-system-react-native to better match design specs by increasing the rendered Icon size for each ButtonIconSize (Sm→Md, Md→Lg, Lg→Xl).

Also adjusts non-floating ButtonIcon styling to use larger rounding (rounded-lg instead of the previous smaller radius), and updates corresponding unit tests to assert the new Tailwind classes.

Written by Cursor Bugbot for commit 518c34d. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

📖 Storybook Preview

@github-actions
Copy link
Contributor

📖 Storybook Preview

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

@github-actions
Copy link
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall marked this pull request as ready for review January 30, 2026 21:52
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner January 30, 2026 21:52
@georgewrmarshall georgewrmarshall self-assigned this Jan 30, 2026
@github-actions
Copy link
Contributor

📖 Storybook Preview

[ButtonIconSize.Lg]: IconSize.Lg,
[ButtonIconSize.Sm]: IconSize.Md,
[ButtonIconSize.Md]: IconSize.Lg,
[ButtonIconSize.Lg]: IconSize.Xl,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon size mapping updated to align with Figma design. ButtonIcon.Sm now uses Icon.Md (20px), ButtonIcon.Md uses Icon.Lg (24px), and ButtonIcon.Lg uses Icon.Xl (32px). Previously icons were one size smaller than intended.

// Non-floating styles
!isFloating && [
'rounded bg-transparent',
'rounded-lg bg-transparent',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Border radius updated from 4px to 8px for non-floating ButtonIcon variants. Floating variants remain fully rounded. This matches the updated Figma design specifications.

[ButtonIconSize.Lg]: IconSize.Lg,
[ButtonIconSize.Sm]: IconSize.Md,
[ButtonIconSize.Md]: IconSize.Lg,
[ButtonIconSize.Lg]: IconSize.Xl,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same icon size mapping update for React Native to maintain consistency across platforms. Verified against Figma design using Figma MCP.

items-center justify-center
${TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[size]}
${isFloating ? 'rounded-full' : 'rounded-sm'}
${isFloating ? 'rounded-full' : 'rounded-lg'}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Border radius updated to 8px for React Native non-floating variants. This aligns with the React implementation and Figma design.

'h-8',
'w-8',
'rounded',
'rounded-lg',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test updated to expect rounded-lg instead of rounded to match the new 8px border radius for non-floating ButtonIcon.

const { result } = renderHook(() => useTailwind());
const tw = result.current;
const expected = tw`items-center justify-center ${TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[ButtonIconSize.Md]} rounded-sm bg-transparent opacity-100`;
const expected = tw`items-center justify-center ${TWCLASSMAP_BUTTONICON_SIZE_DIMENSION[ButtonIconSize.Md]} rounded-lg bg-transparent opacity-100`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test expectations updated throughout to reflect the new rounded-lg class for 8px border radius. All non-floating ButtonIcon tests now expect rounded-lg instead of rounded.

@georgewrmarshall georgewrmarshall merged commit 1dcb7c4 into main Jan 30, 2026
42 checks passed
@georgewrmarshall georgewrmarshall deleted the fix/icon-button-size branch January 30, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants