ion-select-option
Select Options are components that are child elements of a Select. Each option defined is passed and displayed in the Select dialog. For more information, see the Select docs.
Customization#
Each ion-select-option
component that is added as a child of an ion-select
is passed to the interface to display it in the dialog. It's important to note that the ion-select-option
element itself is hidden from the view. This means that attempting to style it will not have any effect on the option in the dialog:
Instead, each interface option has the class .select-interface-option
which can be styled. Keep in mind that due to the overlays being scoped components the selector by itself will not work and a custom cssClass
is recommended to be passed to the interface.
Note: Some interfaces require more in depth styling due to how the options are rendered. See usage for expanded information on this.
The options can be styled individually by adding your own class on the ion-select-option
which gets passed to the interface option. See the Usage section below for examples of styling and setting individual classes on options.
Usage#
- JAVASCRIPT
- REACT
- STENCIL
- VUE
Customizing Options#
Note: In the CSS examples, some of the selectors could be combined together, but are separated out in order to better explain what each selector is for.
Customizing Individual Options#
To customize an individual option, set a class on the ion-select-option
:
Customizing Options#
Note: In the CSS examples, some of the selectors could be combined together, but are separated out in order to better explain what each selector is for.
Customizing Individual Options#
To customize an individual option, set a class on the ion-select-option
:
Customizing Options#
Note: In the CSS examples, some of the selectors could be combined together, but are separated out in order to better explain what each selector is for.
Customizing Individual Options#
To customize an individual option, set a class on the ion-select-option
:
Customizing Options#
Note: In the CSS examples, some of the selectors could be combined together, but are separated out in order to better explain what each selector is for.
Customizing Individual Options#
To customize an individual option, set a class on the ion-select-option
:
Properties#
disabled#
Description | If true , the user cannot interact with the select option. This property does not apply when interface="action-sheet" as ion-action-sheet does not allow for disabled buttons. |
Attribute | disabled |
Type | boolean |
Default | false |
value#
Description | The text value of the option. |
Attribute | value |
Type | any |
Default | undefined |