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
Download Open in Playground Edit
Properties
open
Description Defines if the User Menu is opened. Type booleanDefault false
opener
Description Defines 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. Type HTMLElement | string | null | undefinedDefault undefined
showManageAccount
Description Defines if the User Menu shows the Manage Account option. Type booleanDefault false
showOtherAccounts
Description Defines if the User Menu shows the Other Accounts option. Type booleanDefault false
showEditAccounts
Description Defines if the User Menu shows the Edit Accounts option. Type booleanDefault false
Description Defines if the User menu shows edit button. Type booleanDefault false Since 2.7.0
Slots
default
Description Defines the menu items. Type Array<UserMenuItem>
accounts
Description Defines 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. Type Array<UserMenuAccount>
Events
avatar-click
Description Fired when the account avatar is selected. Type CustomEventBubbles No Cancelable No
manage-account-click
Description Fired when the "Manage Account" button is selected. Type CustomEventBubbles No Cancelable No
edit-accounts-click
Description Fired when the "Edit Accounts" button is selected. Type CustomEventBubbles No Cancelable No
change-account
Description Fired when the account is switched to a different one. Type CustomEvent<UserMenuOtherAccountClickEventDetail>Parameters prevSelectedAccount : UserMenuAccount The previously selected account.selectedAccount : UserMenuAccount The selected account.Bubbles No Cancelable Yes - via preventDefault()
item-click
Description Fired when a menu item is selected. Type CustomEvent<UserMenuItemClickEventDetail>Parameters item : UserMenuItem The selected user menu item.Bubbles No Cancelable Yes - via preventDefault()
open
Description Fired when a user menu is open. Type CustomEventSince 2.6.0 Bubbles No Cancelable No
close
Description Fired when a user menu is close. Type CustomEventSince 2.6.0 Bubbles No Cancelable No
sign-out-click
Description Fired when the "Sign Out" button is selected. Type CustomEventSince 2.6.0 Bubbles No Cancelable Yes - via preventDefault()
Methods
No methods available for this component.
CSS Parts
No CSS parts available for this component.
More Samples
Download Open in Playground Edit