You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v4.x
v5.x
v6.x
Nightly
Current Behavior
Developers are unable to customize the icon that is displayed with ion-select. Developers can change the color of the icon by using CSS:
ion-select::part(icon){color: red;}
But this does not allow the flexibility for developers to customize the icon used.
Ideally, developers would like a property or slot that can be used to customize the icon that is used.
@Prop()toggleIcon=chevronDown;
<ion-select[toggleIcon]="arrowDown"></ion-select>
This icon could then be styled using CSS shadow parts, as the existing implementation is today.
Reacted by Mark Rabey, Nicolas Fazio, Lonesha Akaaba, Henrik Bolte, zer09, Gerard O'Neill, Dragos Bostan, Yanick St-Onge, Sergi Ávila and ACouasnon_perso
changed the title [-]hope change ion-select icons and placeholder color[/-][+]feat: change the ion-select icon and placeholder color[/+]on Feb 26, 2020
I just noticed that this feature was added by #20605 but was then removed for the 5.1 release ( #21108 ). I too would like to be able to customize the style of the icon with an svg instead of the default border one.
Hello everyone 👋 doing some housekeeping here to get this feature request up to date. I will be updating the original poster's description to reflect my understanding of this feature request. Please let me know if that is inconsistent with your expectations or if you have additional requirements you would like to include.
The problem Ionic developers are facing is that the ion-select icon is created through CSS. Developers can change the color of this icon with the following CSS:
ion-select::part(icon){color: red;}
But they cannot customize the icon that is rendered. The ask here, is to support either a slot for developers to customize what is used as the "icon" for ion-select or allowing developers to pass through an ion-icon to be used.
Similar implementation patterns that exist for reference:
ion-accordion has @Prop() toggleIcon = chevronDown which allows developers to specify a different toggleIcon in their implementations.
Reacted by Indraraj, Thibault, jonz94 and Jorge Vergara
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
FazioNico commentedon Mar 28, 2019
looking forward for
fer-fullstackdev commentedon Apr 15, 2019
I need this feature right now. Please let me know when can you do this??
Thanks
dylan-westbury commentedon May 23, 2019
To explain further.
Currently ion-select icon sits in the shadow-root, so there is no way of disabling or editing it.
With our use case, we use the detail on ion-items, and floating labels for ion-inputs, ion-selects, etc.
For ion-select, it looks like this because we can't disable the select-icon.
Here it is in the html of the above ion-select
fer-fullstackdev commentedon May 23, 2019
Hello, @dylan-westbury
Thanks for the explanation.
When can you implement this feature then?
[-]hope change ion-select icons and placeholder color[/-][+]feat: change the ion-select icon and placeholder color[/+]Lougnar commentedon Apr 27, 2020
Currently we can use ::part to change the icon. but it's only supported in the last versions of safari/safari ios and not supported yet in samsung browser. (I have 6% of my users on samsung browser) https://caniuse.com/#search=%3A%3Apart
we should maybe make a pull request to add a slot element, ::slotted is more supported.
kawazoe commentedon Aug 18, 2020
I just noticed that this feature was added by #20605 but was then removed for the 5.1 release ( #21108 ). I too would like to be able to customize the style of the icon with an svg instead of the default border one.
indraraj26 commentedon Sep 25, 2020
Hi @liamdebeasi ,
We have searchIcon in ion-searchbar like that please add dropdownIcon where we can add svg and string from ionicon.
I tried but couldn't able to do it properly.
Playground link: https://codepen.io/indraraj26/pen/vYGPLMQ
sean-perkins commentedon Jul 28, 2022
Hello everyone 👋 doing some housekeeping here to get this feature request up to date. I will be updating the original poster's description to reflect my understanding of this feature request. Please let me know if that is inconsistent with your expectations or if you have additional requirements you would like to include.
The problem Ionic developers are facing is that the
ion-selecticon is created through CSS. Developers can change the color of this icon with the following CSS:But they cannot customize the icon that is rendered. The ask here, is to support either a slot for developers to customize what is used as the "icon" for
ion-selector allowing developers to pass through anion-iconto be used.Similar implementation patterns that exist for reference:
ion-accordionhas@Prop() toggleIcon = chevronDownwhich allows developers to specify a differenttoggleIconin their implementations.[-]feat: change the ion-select icon and placeholder color[/-][+]feat: Support custom icons for `ion-select`[/+]feat(select): add props to customize toggle icons (#27648)
averyrousseau commentedon Jun 20, 2023
Props for customizing the icons have been added via #27648 and will be available in the next upcoming minor release of Ionic. Thank you!
ionitron-bot commentedon Jul 20, 2023
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.