Avatar

The Avatar component is used to display a user's profile image, initials, or custom content with support for status indicators.

Usage

Default

<Avatar name="Davin Chiupka" />

Props

Data table
TypeDescription
altstringAlternative text for the avatar image. Used as the image alt text and may also contribute to the accessible name.
aria-currentboolean | "page" | "step" | "location" | "date" | "time"Indicates the current state or item within a set when the avatar acts as a link. Example: page, step, location, date, time, true.
aria-describedbystringReferences the element(s) that describe the avatar with additional context. Useful for status, activity, or profile details.
aria-labelstringExplicit accessible name for the interactive avatar element. Overrides inferred labels such as label, alt, or name.
aria-labelledbystringReferences the element(s) that label the avatar. Should take precedence over aria-label when provided.
childrenReactNodeCustom child elements (replaces avatar content entirely).
classNamestringCustom class names for the avatar container.
data-testidstringOptional test ID for testing frameworks.
disabledbooleanDisables interaction and styles as disabled.
fallbackReactNodeCustom fallback content (overrides initials).
hrefstringIf provided, avatar becomes a link (internal or external).
labelstringVisible or semantic label for the avatar. Used as a fallback accessible name when aria-label / aria-labelledby are not provided.
namestringFull name used to generate initials when no image is available.
onClick((e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void)Click handler (used only when not a link).
outlinebooleanWhether to apply an outline style.
prioritybooleanIf true, the image loads with higher priority.
roleAriaRoleOptional role override for custom avatar rendering patterns. In most cases this should be left undefined so the native button/link role is preserved.
shadowShadowTypeShadow of the avatar ('none' | 'light' | 'medium' | 'strong' | 'intense').
shapeShapeTypeShape of the avatar border ('circle' | 'square' | 'rounded').
sizeSizeTypeSize of the avatar ('xs' | 'small' | 'medium' | 'large' | 'xl').
srcstringOptional image URL for avatar display.
stateStateTypeState of the avatar ('success' | 'error' | 'warning').
statusStatusTypeOptional status indicator for user availability and activity. Useful for chat apps, collaboration tools, or profile displays.
statusIconReactNodeCustom icon to replace the default status dot.
statusLabelstringOptional accessible label for the status indicator. Example: "Online", "Busy", or "In a meeting". Helpful when the status conveys important information not otherwise described nearby.
statusPositionStatusPositionTypePosition of the status indicator dot/icon ('topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight').
themeThemeTypeVisual theme of the avatar ('primary', 'secondary', 'tertiary', 'quaternary', 'clear').