Avatar

Avatar is a component that displays a profile picture or an icon with initials representing a user.

Usage

import { Avatar, AvatarGroup } from "@yamada-ui/react"
<Avatar />
<AvatarGroup.Root>
  <AvatarGroup.Item />
</AvatarGroup.Root>

Change Variant

Change Size

Change Shape

Display Initials

When you set a string to name, an icon with the user's initials will be displayed.

Display an Image

If you want to display an image in the avatar, set the path to src.

Fallback

There are two fallbacks if the loading of src fails:

  • If name is provided: It uses an icon with the user's initials
  • If name is not provided: It uses the default avatar icon.

Customize the Fallback

Here is an example of customizing the fallback icon and background color.

Use random color

Grouping

If you want to control the number of avatars displayed, specify a number with max. If there are more avatars than the specified number, it truncates and displays the remaining avatars as +X.

Props

Accessibility

Currently, this section is being updated due to the migration of v2.