Skip to content

How to add custom icon to Menu/ComboBox? #1896

Answered by snowystinger
valikron asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, thanks for your interest! So right now slots are only enabled on some elements that are commonly used across different components. In your case, you're looking for something to go in the 'icon' named slot. Our Icon component does this by default, and all of our icons are wrapped in this component, which is why you can just throw them in. If you wrap your icon in our Icon component, that should solve the positioning issue for you. https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/icon/src/Icon.tsx
There may be an issue with color though, so please let me know if you run into any other issues after doing this.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@valikron
Comment options

@valikron
Comment options

@snowystinger
Comment options

@valikron
Comment options

Answer selected by valikron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants