Skip to content

Icon

Render a single icon from supported libraries (prefer Material Icons with mi: prefix, e.g. mi:save).

HTML tag: c-e0a523725f9fb48e78c62fc23f387408a

  • decorative or labeled glyph (mi: prefix)
  • icon inside button, breadcrumb, or list row
  • not for user photos or workflow status
PropTypeDefaultDescription
iconstring
aria_labelstring
appearancestringsoft
tonestringneutral
sizestringmd
lazybooleantrue
adopt_css_into_shadowbooleantrue
mi_css_hrefstringhttps://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0
fa_css_hrefstringhttps://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css
vaadin_icon_module_hrefstring/node_modules/@vaadin/icon/vaadin-icon.js
vaadin_icons_set_module_hrefstring/node_modules/@vaadin/icons/vaadin-icons.js
webawesome_module_hrefstring
densitystringcomfortable
csp_noncestring
  • .icon is required and must include the library prefix (mi:chevron_right, fa:, etc.).
  • Set .aria_label when the icon conveys meaning without adjacent text.
  • appearance/tone/size/density style the glyph container (defaults: soft, neutral, md, comfortable).
  • lazy=true defers heavy font/module loads.
EventDetail
deps-loadedlib: string
load-errorlib: string, error: string
SignatureDescription
ensureDeps(lib: string)
renderIcon(lib: string, name: string, aria: string, t: string, s: string, d: string)
loadCSS(href: string)
loadModule(href: string)
adoptCssIntoShadow(href: string)

Do not use ab-icon for user photos (ab-avatar). Do not use ab-icon alone as a large clickable target without aria_label — wrap with ab-button or make parent interactive. Do not invent unprefixed icon names.

<c-e0a523725f9fb48e78c62fc23f387408a .icon=${'mi:edit'} .size=${'sm'} .tone=${'neutral'} .aria_label=${'Edit'}></c-e0a523725f9fb48e78c62fc23f387408a>