Reference Source
import {Icon} from '@adobe/coral-spectrum'
public class | source

Icon

Expression Extends:

class Icon extends BaseComponent(HTMLElement)

Mixin Extends:

HTMLElement, BaseComponent

An Icon component. Icon ships with a set of SVG icons.

See:

Example:

Markup
<coral-icon></coral-icon>
JS constructor
new Coral.Icon();

Static Member Summary

Static Public Members
public static

Returns Icon autoAriaLabel options.

public static

Returns Icon sizes.

Static Method Summary

Static Public Methods
public static

load(url: String)

Loads the SVG icons.

Member Summary

Public Members
public

Whether aria-label is set automatically.

public

Icon name.

public

Size of the icon.

Static Public Members

public static autoAriaLabel: IconAutoAriaLabelEnum: * source

Returns Icon autoAriaLabel options.

public static size: IconSizeEnum: * source

Returns Icon sizes.

Return:

IconSizeEnum

Static Public Methods

public static load(url: String) source

Loads the SVG icons. It's requesting the icons based on the JS file path by default.

Params:

NameTypeAttributeDescription
url String
  • optional

SVG icons url.

Public Members

public autoAriaLabel: String source

Whether aria-label is set automatically. See IconAutoAriaLabelEnum.

  • IconAutoAriaLabelEnum.OFF by default.

public icon: String source

Icon name.

  • "" by default.
  • reflected

public size: String source

Size of the icon. It accepts both lower and upper case sizes. See IconSizeEnum.

  • IconSizeEnum.SMALL by default.
  • reflected