The ion-select component does not allow direct tuning for itself, and everything that you add to ion-select and ion-option, which does not correspond to the ion documentation, will be ignored in the generated output.
You cannot add a class or style to a component.
One way to do this is to put ion-select in the parent element, such as a div or ion-row, etc. With the class, and apply CSS rules using the .parentclass childElement selector.
To show images in options, check the function below:
prepareImageSelector() { setTimeout(() => { let buttonElements = document.querySelectorAll('div.alert-radio-group button'); if (!buttonElements.length) { this.prepareImageSelector(); } else { for (let index = 0; index < buttonElements.length; index++) { let buttonElement = buttonElements[index]; let optionLabelElement = buttonElement.querySelector('.alert-radio-label'); let image = optionLabelElement.innerHTML.trim(); buttonElement.classList.add('imageselect', 'image_' + image); if (image == this.image) { buttonElement.classList.add('imageselected'); } } } }, 100); }
I implemented a color and image selector using ion-select. Please refer to https://github.com/ketanyekale/ionic-color-and-image-selector
You can also check the response on Ionic to select color input.
source share