Avatar

An image element with a fallback for representing the user.

Default

Standard avatar with image and fallback.

CN

Sizes

Avatars come in three sizes: sm, default, and lg.

SNSNSN

Badges & Status

Add status indicators or icons using the badge component.

NGSNJD

Avatar Groups

Stack multiple avatars together using the group component.

CNSNNG+3CNSNNG+5

Dropdown Integration

Avatars are commonly used as triggers for user menus.

Installation & Usage

Installation

Imports

Basic Skeleton

API Reference

Brain API

The brain directives provide the functional logic for image loading and fallbacks.

DirectiveSelectorDescription
BrnAvatarhlm-avatar, [brnAvatar]Main container that manages image loading states.
BrnAvatarImageimg[hlmAvatarImage], [brnAvatarImage]Directive for the image element. Handles error events.
BrnAvatarFallback[hlmAvatarFallback], [brnAvatarFallback]Displayed when the image fails to load or is not provided.

Helm API

The helm components provide the default spartan/ui styling.

Component / DirectiveSelectorInputs
HlmAvatarhlm-avatar
  • size: 'default' | 'sm' | 'lg'
HlmAvatarBadgehlm-avatar-badge, [hlmAvatarBadge]Small status indicator positioned on the avatar.
HlmAvatarGrouphlm-avatar-group, [hlmAvatarGroup]Wrapper for multiple avatars with overlap styling.