eds-avatar

Explore the Interactive Component

Use the playground below to experiment with the component. Click the button to view the full Storybook deployment for additional examples and configurations.

eds-avatar Open in Storybook

See It in Use with Code

Check out this practical implementation of component.

When you’re using the component directly in HTML (or in frameworks that don’t support property binding), you must pass the values like:

In React

In Vue

Overview

EdsAvatar is a component for displaying user profile representations, including initials or profile pictures. This component is customizable to adapt to various styles and use cases.

Key features include:

  • Display user initials generated from firstName and lastName or use custom initials.
  • Option to display a profile picture if a URL is provided.
  • Round, brand-tinted ground (‘grey’ = soft green tint, ‘black’ = brand black) with Plex initials.
  • Three sizes (small 32px, medium 40px, large 54px — the default).

Properties

PropertyAttributeDescriptionTypeDefault
colorcolorBackground color: ‘grey’ for the soft brand-tinted ground (default), ‘black’ for brand black with accent text."black" | "grey"'grey'
firstNamefirst-nameFirst name of the user for generating initials.string''
initialsinitialsCustom initials to display if provided; otherwise, initials will be derived from firstName and lastName.stringundefined
lastNamelast-nameLast name of the user for generating initials.string''
picturepictureURL or path to the user’s profile picture.stringundefined
sizesizeSize: ‘small’ (32px), ‘medium’ (40px) or ’large’ (54px, default)."large" | "medium" | "small"'large'

Dependencies

Used by

Depends on

Graph

graph TD;
  eds-avatar --> eds-img
  eds-user --> eds-avatar
  style eds-avatar fill:#f9f,stroke:#333,stroke-width:4px

Built with StencilJS