Skip to main content

Icon

<gstock-icon> | GstockIcon

API

Properties

Name Description Reflects Type Default
name The name of the icon to draw. Available names depend on the icon library being used. Reflects string | undefined -
src An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and can result in XSS attacks. string | undefined -
label An alternate description to use for assistive devices. If omitted, the icon will be considered presentational and ignored by assistive devices. string ''
library The name of a registered custom icon library. Reflects string 'default'
size The size of the icon. Reflects 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' 'medium'
updateComplete

A read-only promise that resolves when the component has finished updating.

Learn more about attributes and properties .

Events

Name React Event Description Event Detail
gstock-load-event onGstockLoadEvent Emitted when the icon has loaded. -
gstock-error-event onGstockErrorEvent Emitted when the icon fails to load due to an error. -

Learn more about events .

CSS Parts

Name Description
svg The internal SVG element.
use The element generated when using spriteSheet: true

Learn more about CSS parts .