--- title: "Avatar" slug: avatar category: component type: documentation version: 20.0.0 tokens: 745 source: https://ovh.github.io/design-system/v20.0.0/llms/react-components-avatar--documentation.txt --- # Avatar _**Avatar** is a visual representation of a user or entity, supporting multiple content types such as user images, icons, and user initials._ ## Overview The **Avatar** component is a visual representation of a user or entity, supporting multiple content types such as user images, icons, and user initials. | | | |---|---| | Name | Avatar | | Design | https://www.figma.com/design/mwZtfuQ9nzv6fY0dfez4NZ/-Q3-2026--IA-element?node-id=18697-768 | | Source | https://github.com/ovh/design-system/tree/master/packages/ods-react/src/components/avatar | ## Usage The **Avatar** component is commonly used to represent users, bots, or systems in various applications, such as chat interfaces, user profiles, or notification systems. It is commonly used for: * **User profiles**: display a user's avatar next to their name and other profile information * **Chat interfaces**: use avatars to represent users or bots in a conversation * **Notification systems**: display an avatar for the sender or recipient of a notification * **Team or member lists**: show avatars for each team member or user in a list * **Comment sections**: display an avatar for each commenter to help identify the author of a comment ### Dos & Don'ts **Do** - Use the Avatar component to represent a user or entity in a concise and recognizable way - Choose the appropriate content type (image, icon, or initials) based on the context and available information - Use the Avatar component with sufficient contrast or color scheme **Don't** - Don't use the Avatar component as a decorative element or without a clear purpose - Don't overload the Avatar component with too much information or complex graphics - Don't use an Avatar that is too small or too large for the context, which can affect readability and recognition - Don't forget to provide a fallback logic for cases where the image fails to load or no name is provided (i.e. initials, icons) ### Best Practices in Context 1. **Avatar** ## Behavior The **Avatar** component is a static display-only element, providing a visual representation of a user or entity without any interactive functionality. The component follows a content priority chain: * If **children** are provided, they are displayed (initials, custom icon, etc.) * If a **src** URL is provided, an image is rendered * If the image fails to load (error), the **fallback** content is displayed * If no fallback is provided, a default user icon is shown ## Navigation The **Avatar** component is non-interactive and does not receive keyboard focus when used alone. ## Accessibility When used inside interactive contexts (e.g. next to a user name link or inside a button), ensure the parent element provides the necessary accessible label. When the **Avatar** displays an image, the `alt` attribute is empty by default since the avatar is typically decorative. If the avatar conveys meaningful information, wrap it in an element with an appropriate `aria-label`.