Skip to content

feat: Allow in <ion-icon> to pass directly an hardcoded svg #927

@SvenBudak

Description

@SvenBudak

I use <ion-icon> to visualize the back button in a <ion-toolbar> which is used in a modal.
This is my Syntax:

<ion-header>
    <ion-toolbar color="primary">
        <ion-title>{{contact.firstName}} {{contact.lastName}}</ion-title>
        <ion-buttons slot="start">
            <ion-button (click)="dismissModal()">
                <ion-icon slot="icon-only" src="/assets/icons/feather/arrow-left.svg"></ion-icon>
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>

The problem here is, that when the modal gets rendered the svg icon is not instant loaded. It lazy load about 1 second after the modal opens. It would be very helpful if <ion-icon> something like this:

<ion-header>
    <ion-toolbar color="primary">
        <ion-title>{{contact.firstName}} {{contact.lastName}}</ion-title>
        <ion-buttons slot="start">
            <ion-button (click)="dismissModal()">
                <ion-icon slot="icon-only">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                        <line x1="19" y1="12" x2="5" y2="12"></line>
                        <polyline points="12 19 5 12 12 5"></polyline>
                    </svg>
                </ion-icon>
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions