Skip to content

Enhancement: allow <ion-icon> to use custom icons #535

@cjorasch

Description

@cjorasch

Currently the ion-icon component (and other related components in ionic core) can only be used to load ionic icons by name. This works fine for many cases but it is often desired to use an icon that is not part of ionicons.

With <ion-icon> as a closed system that does not support other icons there will likely be ongoing requests for other icons to be part of ionicons which would likely be challenging to scale.

There are a couple of ways that this could be accomplished:

  • <ion-icon svg={myIcon} /> - new property to specify the svg content directly
  • <ion-icon icon={myIcon} /> - flexible property that could be name or svg (based on pattern)
  • register custom names in global dictionary so that name can map to file path or svg content.

Note that there are other components in the broader ionic core framework that would be impacted as well. For example, <ion-tab> if the developer wants to use an icon that is not in ionicons.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions