--- title: Avatar description: 'Show a user’s profile image or initials in a compact, visual element.' api_name: app-home source_url: html: 'https://shopify.dev/docs/api/app-home/polaris-web-components/media/avatar' md: 'https://shopify.dev/docs/api/app-home/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 ``` ## Examples Component examples ### Basic usage Basic usage Displays a customer avatar with their initials when no profile image is available. Default avatar (no props) Shows a generic person icon placeholder when no user information is available. With image source and fallback Loads a customer profile image with automatic fallback to initials if the image fails to load. Size variations Displays customer and merchant avatars in different sizes for various interface contexts. Long initials handling Shows how the component handles store and business names of varying lengths in commerce contexts. Color consistency demo Demonstrates that identical initials always receive the same color assignment across different store types. Error handling example Shows automatic fallback to initials when customer or merchant profile images fail to load. In customer list context Typical usage pattern for displaying customer avatars in order lists or customer listings. Staff member profiles Shows staff member avatars in different admin interface contexts. With Section component Demonstrates avatar integration with other admin-ui components in a merchant section layout. Fulfillment partner avatars Shows avatars for different types of fulfillment partners in the Shopify ecosystem. ### 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 ```