Shows an SVG icon from a collection of registered icons.

Element
igc-icon

Remarks

The icon component renders SVG icons from registered icon collections. Icons can be:

  • The internal icons that the library components use
  • Registered dynamically using registerIcon or registerIconFromText
  • Referenced by aliases that resolve differently based on the active theme

An alias resolves for the active theme, also inside a theme provider. The component subscribes to the icon registry and updates automatically when icons are registered or references are updated.

Example

<!-- Use an icon registered in the default collection -->
<igc-icon name="star"></igc-icon>

<!-- Use an icon from a specific collection -->
<igc-icon name="search" collection="material"></igc-icon>

<!-- Mirror the icon for RTL layouts -->
<igc-icon name="arrow-forward" mirrored></igc-icon>

The registered collection to look the icon up in.

collection: string = 'default'

Defined in src/components/icon/icon.ts:109

Remarks

Collections allow organizing icons into logical groups. The "default" collection is used for most icons. Custom collections can be created by registering icons with a specific collection name.

Whether the icon is flipped horizontally, for example for RTL layouts.

mirrored: boolean = false

Defined in src/components/icon/icon.ts:123

Remarks

When true, the icon is flipped horizontally using CSS transform. This is particularly useful for directional icons (arrows, chevrons) in right-to-left language contexts.

The name of the icon glyph to draw.

name: string = ''

Defined in src/components/icon/icon.ts:95

Remarks

The icon name can be:

  • A direct reference to a registered icon in the specified collection
  • An alias that resolves to different icons based on the current theme

When the icon name or collection changes, the component looks up and renders the new icon in the registry.

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

tagName: "igc-icon" = 'igc-icon'

Defined in src/components/icon/icon.ts:61

connectedCallback(): void

Defined in src/components/icon/icon.ts:126

Returns void

disconnectedCallback(): void

Defined in src/components/icon/icon.ts:137

Returns void