Skip to content
On this page

VMenu

Props

NameTypeDescription
anchorEnum:
string
HTMLElement
ID or direct reference to the component's anchor element.
aria-currentEnum:
page
step
location
date
time
true
false
Indicates the element that represents the current item within a container or set of related elements.
aria-labelstring
placementEnum:
top
right
bottom
left
top-start
top-end
right-start
right-end
bottom-start
bottom-end
left-start
left-end
placement of the menu
triggerEnum:
auto
legacy
off
Controls how the menu opens and closes itself.
auto-dismissbooleanindicates whether the menu will automatically close when focus moves away from it.
openbooleanindicates whether the menu is open

Events

NameEvent TypeDescription
clickMouseEventFires when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
focusFocusEventFires when the element receives focus.
blurFocusEventFires when the element loses focus.
keydownKeyboardEventFires when a key is pressed.
keyupKeyboardEventFires when a key is released.
inputEventFires when the value of an element has been changed.
openCustomEvent<undefined>Fired when the menu is opened
closeCustomEvent<undefined>Fired when the menu is closed

Slots

NameDescription
defaultDefault slot.
anchorUsed to set the anchor element for the menu.
headerUsed to add additional content to the top of the menu.
action-itemsUsed to add action items to the bottom of the menu.

Methods

NameTypeDescription
focus() => voidFocuses the first item in the menu.
collapseExpandedItem() => voidCollapses any expanded menu items.
openChanged(_: boolean,newValue: boolean) => void