When to use
Section titled “When to use”Avatar identifies a person or a company in a small space: a list row, a comment, a user menu, team members. Without a picture the initials do the same job, so rows keep their alignment.
When not to use
Section titled “When not to use”- For a product or content image: Avatar is for identity; use img for photos and product images.
- For an icon: use Icon for a symbol that explains an action or a type.
- To carry a status alone: the status dot is a hint; write an important status as text with a Badge.
- For a clickable profile: Avatar is not interactive; put it inside a link or a button.
Anatomy
Section titled “Anatomy”- Root: a 24-64 px box; a circle for a person, a
radius-mdsquare for a company. It carriesrole="img"and the name. - Image (
Avatar.Image): appears within 110 ms once loaded; itsaltis empty. - Fallback (
Avatar.Fallback): the initials while the image loads or if it never does; an icon without a name. - Status (
Avatar.Status): a dot at the bottom inline end with a 2 px surface ring. - Group (
Avatar.Group): overlapping avatars and a “+N” count.
Behaviour
Section titled “Behaviour”- The fallback shows while the image loads. Use
delayto hold it back and avoid a flash of initials on a fast connection. - When the image has loaded it replaces the fallback and fades in by opacity. If it fails, the fallback stays.
- The initials are the first letter of the first two words, at most 2 characters, upper-cased for the Provider language.
- An Avatar takes no focus and has no interaction.
- In a group, avatars beyond
maxare counted as “+N”.
Guidelines
Section titled “Guidelines”Make the avatar decorative when the name is beside it
Section titled “Make the avatar decorative when the name is beside it”When the name is printed next to the avatar, set decorative; a screen reader does not read the name twice.
User 1
U1User 1
Give the real name
Section titled “Give the real name”name should always be the full name of the person or company.
U2
U
One size in one place
Section titled “One size in one place”Avatars in one list share a size.
U1U2
U1U2
Content
Section titled “Content”- Pass the full name of the person or company as
name: “User 1”, “Sample Ltd”. - Do not write alternative text for the picture; Avatar leaves
altempty and puts the name on the root. - Make the group
aria-labela short name for the team: “Team”.