--- title: Avatar description: 'Show a user’s profile image or initials in a compact, visual element.' api_version: 2025-10 api_name: admin-extensions source_url: html: >- https://shopify.dev/docs/api/admin-extensions/latest/polaris-web-components/media/avatar md: >- https://shopify.dev/docs/api/admin-extensions/latest/polaris-web-components/media/avatar.md --- # Avatar Show a user’s profile image or initials in a compact, visual element. ## Properties * alt string An alternative text that describes the avatar for the reader to understand what it is about or identify the user the avatar belongs to. * initials string Initials to display in the avatar. * size "small" | "small-200" | "base" | "large" | "large-200" Default: 'base' Size of the avatar. * src string The URL or path to the image. Initials will be rendered as a fallback if `src` is not provided, fails to load or does not load quickly ## Events Learn more about [registering events](https://shopify.dev/docs/api/app-home/using-polaris-components#event-handling). * error OnErrorEventHandler * load CallbackEventListener\ | null ### CallbackEventListener ```ts (EventListener & { (event: CallbackEvent): void; }) | null ``` ### CallbackEvent ```ts Event & { currentTarget: HTMLElementTagNameMap[T]; } ``` ### Examples * #### Code ##### jsx ```jsx ``` ##### html ```html ``` ## Useful for * Identifying individuals or businesses * Representing merchants, customers, or other entities visually * Seeing visual indicators of people or businesses in lists, tables, or cards ## Best practices * `small-200`: use in tightly condensed layouts * `small`: use when the base size is too big for the layout, or when the avatar has less importance * `base`: use as the default size * `large`: use when an avatar is a focal point, such as on a single customer card * `large-200`: use when extra emphasis is required ## Content guidelines For avatars, we recommend using a format that describes what will show in the image: * alt="Person's name" if avatar represents a person * alt="Business's name" if avatar represents a business * alt="" if the name appears next to the avatar as text ## Examples Component examples ### Basic usage ### Examples * #### Basic usage ##### Description Displays a customer avatar with their initials when no profile image is available. ##### jsx ```jsx ``` ##### html ```html ``` * #### Default avatar (no props) ##### Description Shows a generic person icon placeholder when no user information is available. ##### jsx ```jsx ``` ##### html ```html ``` * #### With image source and fallback ##### Description Loads a customer profile image with automatic fallback to initials if the image fails to load. ##### jsx ```jsx ``` ##### html ```html ``` * #### Size variations ##### Description Displays customer and merchant avatars in different sizes for various interface contexts. ##### jsx ```jsx ``` ##### html ```html ``` * #### Long initials handling ##### Description Shows how the component handles store and business names of varying lengths in commerce contexts. ##### jsx ```jsx ``` ##### html ```html ``` * #### Color consistency demo ##### Description Demonstrates that identical initials always receive the same color assignment across different store types. ##### jsx ```jsx {/* Note: Both AB avatars will have the same color */} ``` ##### html ```html ``` * #### Error handling example ##### Description Shows automatic fallback to initials when customer or merchant profile images fail to load. ##### jsx ```jsx ``` ##### html ```html ``` * #### In customer list context ##### Description Typical usage pattern for displaying customer avatars in order lists or customer listings. ##### jsx ```jsx Alice's jewelry store Bob's pet supplies Charlie's coffee corner ``` ##### html ```html Alice's jewelry store Bob's pet supplies Charlie's coffee corner ``` * #### Staff member profiles ##### Description Shows staff member avatars in different admin interface contexts. ##### jsx ```jsx ``` ##### html ```html ``` * #### With Section component ##### Description Demonstrates avatar integration with other admin-ui components in a merchant section layout. ##### jsx ```jsx Premium store Shopify Plus merchant Monthly revenue: $45,000 ``` ##### html ```html Premium store Shopify Plus merchant Monthly revenue: $45,000 ``` * #### Fulfillment partner avatars ##### Description Shows avatars for different types of fulfillment partners in the Shopify ecosystem. ##### jsx ```jsx Third-party logistics Dropship supplier Warehouse hub ``` ##### html ```html Third-party logistics Dropship supplier Warehouse hub ```