@zendeskgarden/react-avatars package provides the Avatar and StatusIndicator components. Use Avatar to represent a user or system with an image, icon, or initials. Use StatusIndicator as a standalone presence badge.
Installation
Avatar
Avatar renders a single child — an <img>, an SVG icon, or an Avatar.Text — inside a styled container. Wrap your app in ThemeProvider before using any Garden component.
Size
Thesize prop controls the avatar dimensions. The default is medium.
- Image
- Text
Status
Set thestatus prop to show a presence indicator on the avatar. When status is set, also provide a statusLabel for screen readers.
| Status value | Visual meaning |
|---|---|
available | Green indicator — agent is online and available |
away | Yellow indicator with clock icon — agent is away |
transfers | Blue indicator with arrow icon — agent accepts transfers |
offline | Grey indicator — agent is offline |
Badge
Set thebadge prop to display a notification count. The status prop is overridden to active when badge is provided.
System avatars
SetisSystem to apply styling intended for objects, brands, or products rather than people.
Avatar.Text
UseAvatar.Text as the child of Avatar to display initials or short text.
Props
Sets the avatar dimensions.
Applies a presence indicator to the avatar.
Accessible label for the status indicator. Required when
status is set and the avatar is not aria-hidden.Displays a notification count and sets the status to
active. Takes precedence over the status prop.Sets the avatar background color. Accepts a theme color variable key (e.g.
background.emphasis) or a hex value.Sets the color for child SVG or
Avatar.Text content. Accepts a theme color variable key (e.g. foreground.onEmphasis) or a hex value.Provides a surface color for avatars placed on non-default backgrounds. Accepts a theme color variable key or a hex value.
Applies system styling for representing objects, brands, or products.
StatusIndicator
StatusIndicator is a standalone presence component — use it outside of an Avatar when you need to show a user’s status alongside their name or in a list.
Compact styling
UseisCompact to reduce the indicator size, for example inside dense list rows.
Props
Applies status styling and sets the default accessible label.
Overrides the auto-generated label. Pass
null to mark the indicator as decorative and suppress the label.Applies compact styling with smaller icons.