# Menu

The Menu component is a list of items arranged in a vertical, expandable list used for navigation within a dashboard. Each item can be clicked to show children, navigate to another page, or execute a function.

# Items

Use the items prop to build your menu as a MenuItem[]. See the Interfaces section for a full list of options.

In this demo, each item will alert it's name when clicked.

# Collapsed

Use the collapsed prop to collapse your menu to just the icons. Children will be shown via Popovers instead of expanding.

In this demo, each item will link to a page in the documentation website when clicked. Here we're also demoing the same menu in a collapsed and expanded state, so the different interactions can be see.

# Events

There are several events at your disposal.

Event Arguments Description
@expand The MenuItem that was expanded Emitted whenever a menu item's children are expanded
@collapse The MenuItem that was collapsed Emitted whenever a menu item's children are collapsed
@item:click The MenuItem or MenuItemChild object of the clicked item Emitted whenever a menu item is clicked
@action:click {item: MenuItemChild, action: MenuItemAction} Emitted whenever an action is clicked

# Interfaces

Each MenuItem can have the following properties. You cannot combine to, onClick and children and must choose only one for each item.

Property Type Description Required
icon String The icon to render true
text String The text for the menu item true
to Route|string A route to navigate to when clicked. Cannot be combined with onCLick or children false
onClick Function The function to execute when clicked. Cannot be combined with to or children false
children MenuItemChild[] Child items to render in a popover or accordion. Cannot be combined with to or onCLick false
active Boolean Whether the item is active or not. If your app uses vue-router, this will be handled automatically false
childMenuExpanded Boolean Whether the item's child menu is open or not false

Each MenuItem can have the following properties. Unlike MenuItem's they cannot have an icon or children but can have actions.

Property Type Description Required
text String The text for the menu item true
to Route|string A route to navigate to when clicked. Cannot be combined with onCLick false
onClick Function The function to execute when clicked. Cannot be combined with to false
actions MenuItemAction[] Actions to render on the right side of the item false
active Boolean Whether the item is active or not. If your app uses vue-router, this will be handled automatically false

Each MenuItemAction can have the following properties. Actions render as icons that execute a function when clicked.

Property Type Description Required
text String The text for the menu item true
to Route|string A route to navigate to when clicked. Cannot be combined with onCLick false
onClick Function The function to execute when clicked. Cannot be combined with to false
actions MenuItemAction[] Actions to render on the right side of the item false
active Boolean Whether the item is active or not. If your app uses vue-router, this will be handled automatically false
Last Updated: 3/28/2025, 4:22:32 PM