Avatar

The ArcadiaAvatar component shows a user’s profile image or falls back to auto-generated initials derived from the Name parameter.

Basic Usage

<ArcadiaAvatar Name="Jane Doe" Src="/images/jane.jpg" />

<ArcadiaAvatar Name="John Smith" Size="lg" Color="success" />

<ArcadiaAvatar Size="sm" />

Parameters

ParameterTypeDefaultDescription
Namestring?nullThe user’s display name. Used to generate initials when no image is provided.
Srcstring?nullThe image URL for the avatar.
Sizestring"md"Avatar size: "sm", "md", "lg".
Colorstring"primary"Background color for the initials avatar: "primary", "success", "danger", "warning".
Classstring?nullAdditional CSS class names.
Stylestring?nullInline CSS styles.

Accessibility

  • Uses role="img" on the root element.
  • Provides aria-label based on the Name parameter (e.g., “Avatar for Jane Doe”) or “User avatar” as a fallback.
  • The <img> element includes an alt attribute derived from Name.
  • On image load error, the component falls back to initials automatically.