Skip to content

feat: add optgroup to select option #28628

Open

Description

@JulioCVaz

Prerequisites

Describe the Feature Request

I think is interesting to include html <optgroup> tag for ion-select. If is possible I wanna to implement this.

References: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup

Describe the Use Case

Use ion-select with optgroup tag, like:

<IonSelect
          aria-label="Fruit"
          placeholder="Select fruit"
          onIonChange={(e) => console.log(`ionChange fired with value: ${e.detail.value}`)}
          onIonCancel={() => console.log('ionCancel fired')}
          onIonDismiss={() => console.log('ionDismiss fired')}
>
         <IonOptGroup label="Fruits">
             <IonSelectOption value="apples">Apples</IonSelectOption>
             <IonSelectOption value="oranges">Oranges</IonSelectOption>
             <IonSelectOption value="bananas">Bananas</IonSelectOption>
          </IonOptGroup>
</IonSelect>

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

Activity

  1. liamdebeasi commented on Dec 4, 2023

    @liamdebeasi
    Contributor

    Thanks for the report. Can you help me understand what you are trying to accomplish? In the example you provided you can specify a group header using either the label property on ion-select or interfaceOptions: https://ionicframework.com/docs/api/select#interface-options

  2. added
    needs: reply
    on Dec 4, 2023
  3. JulioCVaz commented on Dec 4, 2023

    @JulioCVaz
    Author

    Thanks for the report. Can you help me understand what you are trying to accomplish? In the example you provided you can specify a group header using either the label property on ion-select or interfaceOptions: https://ionicframework.com/docs/api/select#interface-options

    Sure @liamdebeasi

    The ideia is to create a new tag to support optgroup in selects, like in HTML5.

    The interfaceOptions is awesome to create headers and subheaders, but is possible to use in only one Select, correct?

    Simplifying, is to add groups to ion-select :)

  4. added and removed
    needs: reply
    on Dec 4, 2023
  5. liamdebeasi commented on Dec 4, 2023

    @liamdebeasi
    Contributor

    The interfaceOptions is awesome to create headers and subheaders, but is possible to use in only one Select, correct?

    That's correct. The reason why we only have one group in an ion-select is because alert and action sheet only support single groups.

    What problem are you trying to solve by adding multiple groups? Additionally, what are some of the alternatives you have tried?

  6. added
    needs: reply
    on Dec 4, 2023
  7. JulioCVaz commented on Dec 4, 2023

    @JulioCVaz
    Author

    The interfaceOptions is awesome to create headers and subheaders, but is possible to use in only one Select, correct?

    That's correct. The reason why we only have one group in an ion-select is because alert and action sheet only support single groups.

    What problem are you trying to solve by adding multiple groups? Additionally, what are some of the alternatives you have tried?

    Perfect @liamdebeasi . In our company we have a some of selects that using optgroup to select stores and store items for exemple. Like:

    Store 1
    t-shirt
    Store 2
    shoes

    And recently we created a new design system for our UI. But we has this problem to use optgroups. To avoid this, we use disabled options as labels and normal options in the select.

  8. added and removed
    needs: reply
    on Dec 4, 2023
  9. liamdebeasi commented on Dec 4, 2023

    @liamdebeasi
    Contributor

    Which interface are you using with ion-select? (alert, action sheet, popover)

  10. added
    needs: reply
    on Dec 4, 2023
  11. 13 remaining items

  12. locked and limited conversation to collaborators on Oct 28, 2025
  13. unlocked this conversation on Oct 28, 2025
  14. sembo199 commented on Nov 4, 2025

    @sembo199

    I would like to see this feature in Ionic as well. Especially when using long lists of select options, I would want to be able to do some extra grouping for a better user experience. Additionally, I think a widely supperted HTML5 element should for sure be useable in Ionic.

  15. ionitron-bot commented on Nov 4, 2026

    @ionitron-bot

    Thanks for the issue! This issue is being closed due to inactivity. 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.

    Thank you for using Ionic!

  16. locked and limited conversation to collaborators on Nov 4, 2026
  17. unlocked this conversation on Nov 9, 2026
  18. added and removed
    community feedback wanted
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions