Skip to content

@absoluteui/angular/icon

Render registered icons with <aui-icon>.

import { AuiIcon } from '@absoluteui/angular/icon';

Class AuiIcon; template reference #ref="auiIcon".

AbsoluteUI icon outlet: <aui-icon name="calendar" size="sm" />. name is a registered icon name, a name resolved by the icon provider (provideAbsoluteUI({ icons })), or an inline icon definition such as an icon of @absoluteui/icons/set. Decorative unless label is set. Vector icons also take variant, colors, layers, overlays, container, stroke, transform, and animation inputs: colors, layers, stroke width, size, label, and animationState update the rendered icon in place; the other inputs render it again. Animations run in the browser only (the server renders the static icon) and stop when the component is destroyed.

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
name IconRef Required. Registered icon name, or an icon definition (an icon of @absoluteui/icons/set, or one from an icon library adapter).
size number | IconSize Theme size xs to xl, a CSS length such as ‘20px’, or a number of pixels (default: the surrounding icon size, or 1em).
label string Accessible name. Omit for decorative icons; label icon-only buttons on the button instead.
variant IconVariantName Variant of a vector icon (default 'outline'); the icon must provide it.
colors Readonly<Partial<Record<IconColorRole, string>>> Role colors (CSS colors, validated), for example { accent: 'var(--aui-color-success-fg)' }.
layers Readonly<Partial<Record<IconLayerName, IconLayerOverride>>> Per-layer overrides: color, opacity, hidden.
overlays readonly IconOverlayPlacement[] Up to two overlays (@absoluteui/icons/set overlays), one per anchor.
container "circle" | "square" Draws the icon inside a circle or square.
strokeWidth number Outline stroke width in icon units, 0.5 to 4 (default: the inherited --aui-icon-stroke-width, else 2).
strokeScaling "scale" | "fixed" 'fixed' keeps strokes at their width in CSS pixels at any size.
rotate 0 | 90 | 180 | 270
flip "horizontal" | "vertical" | "both"
dir "ltr" | "rtl" | "auto" 'auto' (default) mirrors directional icons in right-to-left layouts; 'ltr' or 'rtl' force a direction.
animation AuiIconAnimation An animation the icon lists (static by default; reduced motion is honored).
animationState IconAnimationState State for state-driven triggers: loading, success, and error play; idle stops.

Call them through a viewChild query or a template reference.

Method Description
play(): void Plays the animation (for manual and on-change triggers).
stop(): void Stops the animation and shows the static end state.

AuiIconAnimation

Animation of an aui-icon; host defaults to the aui-icon element (hover, focus, and press triggers).

type AuiIconAnimation = IconAnimationOptions;

AuiIconColors

Role colors for one icon instance.

type AuiIconColors = Readonly<Partial<Record<IconColorRole, string>>>;

AuiIconLayers

Per-layer color, opacity, or visibility for one icon instance.

type AuiIconLayers = Readonly<Partial<Record<IconLayerName, IconLayerOverride>>>;