Menu
Menu
A list of commands and links, inline or as a popup, with groups and separators.
WAI-ARIA tested
Import
main.ts
import { Menu } from '@vitral/vue';Inline, with groups
Last command: —
Popup
API
Read from packages/vue/src/components/Menu/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| model | MenuItem[] | — |
| popup | boolean | A popup menu, opened by `toggle(event)` / `show(event)` and anchored to the event's element. |
| appendTo | string | Where a popup renders: `'body'` (the default), `'self'` to stay in place, or a selector. |
| placement | OverlayPlacement | — |
| ariaLabel | string | Names the menu. A popup without one is named by the element that opened it. |
| ariaLabelledby | string | — |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| show | — | — |
| hide | — | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| start | — | Content before the items. |
| end | — | Content after the items. |
| item | (props: { item: MenuItem; label: string | undefined; focused: boolean; disabled: boolean }) | An item's content: its icon and label. The menuitem element around it, with its role and keyboard, stays. |
| submenulabel | (props: { item: MenuItem }) | A group's heading. |