Menu
Small, toggleable containers often used for navigation
Demo
See more examples
API
Tag and slots
Name | Type | Content | |||||||
---|---|---|---|---|---|---|---|---|---|
m-menu |
Custom Element | trigger and items slots only | |||||||
slot="trigger" |
Button is recommended, but other elements work | Any | |||||||
slot="items" |
Div | Links, but other content is permitted |
Attributes
Name | Value | Description | |||||||
---|---|---|---|---|---|---|---|---|---|
open |
Boolean attribute | When present the menu is shown; otherwise, it's hidden. |
Events
Name | Detail | Description | |||||||
---|---|---|---|---|---|---|---|---|---|
toggle |
None | Fired after the Menu was removed from the DOM. |
Guidelines
What about <menu>?
This component is only loosely based on the HTMLMenuElement
interface because that spec is incomplete and looks to be deprecated.
Accessibility
There are no accessibility recommendations for menu at this time. This post https://adrianroselli.com/2017/10/dont-use-aria-menu-roles-for-site-nav.html seems reasonable and accurate enough to say that simple markup like anchor tags in menus is sufficient.