# Avatar

The avatar component displays a user’s avatar and name, and provides a menu of actions when clicked.

# Name

Use the name prop to add the name of the user. Can be overridden by default slot. name prop is required.

# Image

Use the image prop to change user’s profile image. image slot can be used to override the image prop. If no prop or slot is presented fallback image will be used.

# Variant

Use variant to change the style and appearance of your avatar. Default variant is md.

# Colapsed

Use the collapsed prop to hide part of avatar component. Whet set to true only user’s profile image will be shown. False by default.

menu prop is an array of menu items to display when the avatar is clicked.

Avatar menu item has following properties.

Property Type Description Required
id String Unique identifier for menu item, used in click event true
icon String Icon that is displayed before text false
text String Text that is displayed in menu item true
destructive Boolean If enabled changes menu item text to red false
disabled Boolean Disables menu item false

menu slot can be used to pass in any custom content to display.

The menu-placement prop can be used to adjust placement of opened menu.

The menu-offset prop can be used to adjust offset placement of opened menu.

# Events

Avatar popover menu has one event @menuItemSelect, fired when the popover menu item is selected.

Last Updated: 12/20/2024, 3:55:39 PM