Class IgxIconComponent

Hierarchy

  • IgxIconComponent

Implements

  • OnInit
  • OnDestroy

Constructors

constructor

Properties

active

active: boolean = true

An @Input property that allows you to disable the active property. By default it's applied.

@example
<igx-icon [isActive]="false">settings</igx-icon>

ariaHidden

ariaHidden: boolean = true

This allows you to disable the aria-hidden attribute. By default it's applied.

@example
@ViewChild("MyIcon") public icon: IgxIconComponent;
constructor(private cdRef:ChangeDetectorRef) {}
ngAfterViewInit() {
    this.icon.ariaHidden = false;
    this.cdRef.detectChanges();
}

el

el: ElementRef

An ElementRef property of the igx-icon component.

font

font: string

An @Input property that sets the value of the fontSet. By default it's "material".

@example
<igx-icon fontSet="material">settings</igx-icon>

iconColor

iconColor: string

An @Input property that allows you to change the iconColor of the icon.

@example
<igx-icon color="blue">settings</igx-icon>

iconName

iconName: string

An @Input property that allows you to set the iconName of the icon.

@example
<igx-icon name="contains" fontSet="filter-icons"></igx-icon>

id

id: string = `igx-icon-${NEXT_ID++}`

An @Input property that sets the value of the id attribute.

@example
<igx-icon id="igx-icon-1" fontSet="material">settings</igx-icon>

Accessors

getActive

  • get getActive(): boolean

getFontSet

  • get getFontSet(): string

getIconColor

  • get getIconColor(): string

getIconName

  • get getIconName(): string

getInactive

  • get getInactive(): boolean

getSvgKey

  • get getSvgKey(): string
  • An accessor that returns the key of the SVG image. The key consists of the fontSet and the iconName separated by underscore.

    @example
    @ViewChild("MyIcon")
    public icon: IgxIconComponent;
    ngAfterViewInit() {
       let svgKey = this.icon.getSvgKey;
    }

    Returns string

template

  • get template(): TemplateRef<HTMLElement>
  • An accessor that returns a TemplateRef to explicit, svg or no ligature.

    @example
    @ViewChild("MyIcon")
    public icon: IgxIconComponent;
    ngAfterViewInit() {
       let iconTemplate = this.icon.template;
    }

    Returns TemplateRef<HTMLElement>