Skip to content

[android][ui] Add icons to ContextMenu and trailingIcon to Button#39095

Merged
Kudo merged 13 commits intoexpo:mainfrom
benjaminkomen:expo_ui_add_icons_to_context_menu
Sep 15, 2025
Merged

[android][ui] Add icons to ContextMenu and trailingIcon to Button#39095
Kudo merged 13 commits intoexpo:mainfrom
benjaminkomen:expo_ui_add_icons_to_context_menu

Conversation

@benjaminkomen
Copy link
Copy Markdown
Contributor

@benjaminkomen benjaminkomen commented Aug 24, 2025

Why

  • In this PR button received the systemImage prop, however, it is useful to be able to place an image in a button either before or after the text. This PR deprecates the systemImage prop and introduces leadingIcon and trailingIcon instead
  • Since the Material UI DropDown component supports leading and trailing icons, and it is a common pattern to be able to show icons for each menu item on the one side and a checkbox on the other side, this PR introduces leadingIcon and trailingIcon for ContextMenu items.
  • This PR attempts to add 3 more icons: LightMode, DarkMode and Contrast so that a Theme selection context menu can be shown.

Demo

expo-ui-context-menu-icons.mp4
Screenshot 2025-08-23 at 9 11 01 PM Screenshot 2025-08-23 at 9 11 15 PM

Test Plan

See the test screens for Button and ContextMenu in native-component-list, with the bare-expo app, on an Android device.

See also

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Aug 24, 2025
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Aug 24, 2025
@benjaminkomen benjaminkomen changed the title [UI] [Android] Add icons to ContextMenu and trailingIcon to Button [android][ui] Add icons to ContextMenu and trailingIcon to Button Aug 24, 2025
@benjaminkomen benjaminkomen marked this pull request as ready for review August 24, 2025 04:00
@github-actions
Copy link
Copy Markdown
Contributor

Subscribed to pull request

File Patterns Mentions
docs/** @amandeepmittal
packages/expo-ui/** @aleqsio, @behenate

Generated by CodeMention

@aleqsio aleqsio requested review from Kudo and aleqsio and removed request for aleqsio August 26, 2025 14:18
Copy link
Copy Markdown
Contributor

@aleqsio aleqsio left a comment

Choose a reason for hiding this comment

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

LGTM

@aleqsio
Copy link
Copy Markdown
Contributor

aleqsio commented Sep 2, 2025

I'd like to standardise on a name (either leadingIcon and leadingImage), and I think going with icon makes more sense here

@benjaminkomen
Copy link
Copy Markdown
Contributor Author

benjaminkomen commented Sep 2, 2025

I'd like to standardise on a name (either leadingIcon and leadingImage), and I think going with icon makes more sense here

Yes, totally, I'll change that!

Edit: actually, I was already using icon instead of image, but I accidentally wrote image in the PR description.. I fixed that, my bad!

Should be good to merge now @aleqsio !

…context_menu

# Conflicts:
#	packages/expo-ui/CHANGELOG.md
# Conflicts:
#	packages/expo-ui/CHANGELOG.md
#	packages/expo-ui/build/jetpack-compose/Button/index.js
#	packages/expo-ui/build/jetpack-compose/Button/index.js.map
#	packages/expo-ui/build/jetpack-compose/Button/types.js.map
#	packages/expo-ui/build/jetpack-compose/ContextMenu/index.js
#	packages/expo-ui/build/jetpack-compose/ContextMenu/index.js.map
#	packages/expo-ui/build/jetpack-compose/ContextMenu/utils.js
#	packages/expo-ui/build/jetpack-compose/ContextMenu/utils.js.map
Copy link
Copy Markdown
Contributor

@Kudo Kudo left a comment

Choose a reason for hiding this comment

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

sorry have you resolving conflicts multiple times. the pr looks good. after resolving the changelog, please re-request review for me and i'll approve and merge the pr. thank you

Copy link
Copy Markdown
Contributor

@Kudo Kudo left a comment

Choose a reason for hiding this comment

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

thanks for the nice pr 👏👏👏

@Kudo Kudo merged commit 3d0474c into expo:main Sep 15, 2025
10 of 11 checks passed
@benjaminkomen benjaminkomen deleted the expo_ui_add_icons_to_context_menu branch September 16, 2025 00:33
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants