logoalt Hacker News

nektroyesterday at 7:19 PM3 repliesview on HN

TIL <menu>, I wonder why more frameworks don't make use of it.


Replies

extra88yesterday at 11:14 PM

Because for the user experience, it is identical to <ul>. Use <menu> if it helps you to understand your code but in the browser's accessibility tree and in all other respects, it's just an unordered list.

Conveying that something is a list of actions requires adding ARIA attributes. The article mentions `role=menu` but that's not enough, each item also needs the `menuitem` role. The WAI Authoring Practices Guide explains the roles and interaction expectations; don't copy their coded examples and definitely don't use the roles for navigation menus.

https://www.w3.org/WAI/ARIA/apg/patterns/menubar/

pphyschyesterday at 7:33 PM

big brain no learn hyperspeak when many div do trick

stirfishyesterday at 8:26 PM

<menu>, <dialog>, lots of fun stuff in html now.

I like to ask people what they imagine <ruby> does, because I certainly didn't guess right.

show 2 replies