Skip to content

feat: ion-select / ion-select-option to support custom HTML to show images or other HTML content. #30673

@Saqib92

Description

@Saqib92

Prerequisites

Describe the Feature Request

We would love to have a support for custom HTML in ion-select / ion-select-option.

Describe the Use Case

For example i have a scenario to show Images with options text for multiple / single selection. custom HTML would be very helpful.

<ion-select label-placement="stacked" fill="outline" class="ion-margin-bottom"  mode="md" interface="popover">
    <div slot="label">User Shift</div>

    @for(item of items; track item?.name){
    <ion-select-option [value]="item?.value">
      <img [src]="item.image" />
      {{s?.name}}
    </ion-select-option>
    }

  </ion-select>

Describe Preferred Solution

ng-selet
ng-select is a good alternative but customizing UI to look like ionic component is very difficult.

Describe Alternatives

https://www.npmjs.com/package/@ng-select/ng-select

Related Code

<ion-select label-placement="stacked" fill="outline" class="ion-margin-bottom"  mode="md" interface="popover">
    <div slot="label">User Shift</div>

    @for(item of items; track item?.name){
    <ion-select-option [value]="item?.value">
      <img [src]="item.image" />
      {{s?.name}}
    </ion-select-option>
    }

  </ion-select>

Additional Information

Custom HTML in select-option would be great value addition to ionic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions