Skip to main content

UserMenu

<ui5-user-menu> | Since 2.5.0
info

The following entity is available under an experimental flag and its API and behavior are subject to change.

The ui5-user-menu is an SAP Fiori specific web component that is used in ui5-shellbar and allows the user to easily see information and settings for the current user and all other logged in accounts.

ES6 Module Import​

import "@ui5/webcomponents-fiori/dist/UserMenu.js";

import "@ui5/webcomponents-fiori/dist/UserMenuItem.js"; (for ui5-user-menu-item)

Basic Sample​

Properties​

open​

DescriptionDefines if the User Menu is opened.
Typeboolean
Defaultfalse

opener​

DescriptionDefines the ID or DOM Reference of the element at which the user menu is shown. When using this attribute in a declarative way, you must only use the id (as a string) of the element at which you want to show the popover. You can only set the opener attribute to a DOM Reference when using JavaScript.
TypeHTMLElement | string | undefined
Defaultundefined

showManageAccount​

DescriptionDefines if the User Menu shows the Manage Account option.
Typeboolean
Defaultfalse

showOtherAccounts​

DescriptionDefines if the User Menu shows the Other Accounts option.
Typeboolean
Defaultfalse

showAddAccount​

DescriptionDefines if the User Menu shows the Add Account option.
Typeboolean
Defaultfalse

Slots​

default​

DescriptionDefines the menu items.
TypeArray<UserMenuItem>

accounts​

DescriptionDefines the user accounts.
Note: If one item is used, it will be shown as the selected one. If more than one item is used, the first one will be shown as selected unless there is an item with selected property set to true.
TypeArray<UserMenuAccount>

Events​

avatar-click​

DescriptionFired when the account avatar is selected.
TypeCustomEvent
BubblesNo
CancelableNo

manage-account-click​

DescriptionFired when the "Manage Account" button is selected.
TypeCustomEvent
BubblesNo
CancelableNo

add-account-click​

DescriptionFired when the "Add Account" button is selected.
TypeCustomEvent
BubblesNo
CancelableNo

change-account​

DescriptionFired when the account is switched to a different one.
TypeCustomEvent<UserMenuOtherAccountClickEventDetail>
ParametersprevSelectedAccount: UserMenuAccount
The previously selected account.
selectedAccount: UserMenuAccount
The selected account.
BubblesNo
CancelableYes - via preventDefault()

item-click​

DescriptionFired when a menu item is selected.
TypeCustomEvent<UserMenuItemClickEventDetail>
Parametersitem: UserMenuItem
The selected user menu item.
BubblesNo
CancelableYes - via preventDefault()

sign-out-click​

DescriptionFired when the "Sign Out" button is selected.
TypeCustomEvent
BubblesNo
CancelableYes - via preventDefault()

Methods​

No methods available for this component.

CSS Parts​

No CSS parts available for this component.

More Samples​