Skip to content

Icon

The glyphs the library draws, available in markup as aparte-icon, sized by the place they sit in.

  • <aparte-icon>
  • .aparte-icon
On this page
Open

<aparte-icon name="copy"> draws one of the glyphs the chat itself uses, from markup, with no script of your own. A glyph carries no size: it takes --aparte-icon-size from its container, so the same drawing serves a small remove button and a large toolbar. --sm, --lg and --xl change it on one icon.

An icon provider (aparteGlobalConfig.setIconProvider()) replaces the set, for the chat and for every <aparte-icon> at once. The full reference, with the extended set behind @aparte/core/icons, is on the icons page.

html
<aparte-icon name="…"></aparte-icon>

Installation and the framework-specific traps: React · Vue · Svelte · Angular.

VariableDefault
--aparte-icon-sizecalc(1rem * var(--aparte-font-scale))
--aparte-icon-size-smcalc(0.75rem * var(--aparte-font-scale))
--aparte-icon-size-lgcalc(1.125rem * var(--aparte-font-scale))
--aparte-icon-size-xlcalc(1.25rem * var(--aparte-font-scale))

<aparte-icon> · class AparteIcon

Attributes

AttributeDescription
nameWhich glyph to draw. One of the names setIconProvider accepts; an unknown name draws nothing rather than a broken-image box.

CSS variables

VariableDefaultDescription
--aparte-icon-sizecalc(1rem * var(--aparte-font-scale))Width and height. --sm/--lg/--xl set it.

.aparte-icon · .aparte-icon--lg · .aparte-icon--sm · .aparte-icon--xl · .aparte-icon-spin

  • The drawing is hidden from screen readers: an icon beside a label is decoration. When the icon is the only content of a button, name the button with aria-label.