How to add custom icon to Menu/ComboBox? #1896
-
Maybe I'm just missing something but I wanted to create a simple language selector with world flags, but when I put my custom svg Icon into an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
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 |
Beta Was this translation helpful? Give feedback.
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 ourIcon
component, that should solve the positioning issue for you. https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/icon/src/Icon.tsxThere may be an issue with color though, so please let me know if you run into any other issues after doing this.