question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: Support custom icons for `ion-select`

See original GitHub issue

Prerequisites

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.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
sean-perkinscommented, 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-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.
1reaction
kawazoecommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic 4 ion-select set custom icon for select-icon - Stack Overflow
In ionic v4 a workaround is hiding the icon through .scss file. ion-select::part(icon) { display: none !important; } ion-select::part(text) ...
Read more >
ion-item-divider - Ionic Framework
Item Dividers are block elements that can be used to separate items in a list. They are similar to list headers, but instead,...
Read more >
ion-refresher background color - You.com | The search engine you ...
No need to customize directive, just set spinner value none to disable both spinner or icon. <ion-refresher spinner="none" on-refresh="changeSlide()"> ...
Read more >
RD8100™ - Radiodetection
A flashing icon means pairing is in progress. 3.3 Using the menu. The RD8100 locator and transmitter menus allow you to select or...
Read more >
Burmax Company
... Black Gold Ion Select for adjustable ionic output to control hair volume and ... cool shot button, removable lint filter, and 9...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found