Skip to content

Avatar for Angular

AngularData display

Picture of a person or entity with fallbacks: the image, then initials from the name, then an optional icon. One image to assistive technology, named after the person and their presence status; decorative when the name is shown next to it.

  • Image with fallbackShows the photo, then initials, then an icon if the image fails.
  • Presence statusOnline, away, busy, and offline indicators with accessible text.
  • Sizes and shapesFive sizes in circle or square shape.
  • Decorative modeHide it from assistive technology when the name is already shown.

Behavior, design tokens, and limitations are described on the Avatar page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiAvatar } from '@absoluteui/angular/avatar';
@Component({
selector: 'app-assignee',
imports: [AuiAvatar],
template: `<aui-avatar [name]="name" size="sm" [status]="online ? 'online' : 'offline'"></aui-avatar>`,
})
export class AssigneeComponent {
name = 'Ada Lovelace';
online = true;
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiAvatar } from '@absoluteui/angular/avatar';

Defaults for every instance: provideAbsoluteUIConfig({ components: { avatar: { ... } } }) (see Configuration).

Class AuiAvatar; template reference #ref="auiAvatar".

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

Input Type Default Description
name string Required. Accessible name and source of the initials.
src string | null Image URL: http(s), relative, blob:, or a base64 PNG, JPEG, GIF, WebP, or AVIF data URL.
icon IconRef | null Icon shown when the name yields no initials.
status AvatarStatus | null Presence dot; its name is part of the accessible name.
decorative boolean false Hide from assistive technology when the name is shown next to it.
size AvatarSize 'md' Avatar size.
shape AvatarShape 'circle' Avatar shape.
locale string 'en-US' Locale of status names and initials casing.

Pattern: Image with a text alternative: role=img on the host, aria-label with the name and presence status.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Avatar: Accessibility and performance.