[Menu] Allow links as MenuItems
See original GitHub issueDescription
Currently, there is no clear way to render anchors as menu items. Existing MenuItem
strongly assumes that it’s going to render a button element:
https://github.com/chakra-ui/chakra-ui/blob/910a701f9f3b16157f287479a3df64a2ea84090b/packages/menu/src/menu.tsx#L259
Problem Statement/Justification
This is a valid use case, implemented as an example here: https://www.w3.org/TR/wai-aria-practices-1.2/examples/menu-button/menu-button-links.html
Proposed Solution or API
Either provide an option on the MenuItem
(could be indirect) or create a new MenuItemLink
component. An example in the docs of how to use this would be appreciated as well.
Alternatives
No response
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Add Links to a Menu – WordPress.com Support
Under Add menu items, tick the boxes for each of the new menu items you wish to add. You can choose from Pages,...
Read more >Menu Items & Menu Item Links : Support Center
Menu Items - Allows the User to set the details for each Menu Item including: Display Name, Estimated Cost, Price, Target Margin, etc....
Read more >Example menu items and content links
The method for choosing a link target (current window, iFrame, or new window) and referencing the item linked (page, attachment, or URL) are...
Read more >Navigation Menu Button Example | APG | WAI - W3C
The menu items are made from HTML links, so they maintain their HTML ... be a menuitem because accessibility APIs do not enable...
Read more >Add a menu item that links to a page section | Beaver Builder ...
You can add a menu item whose link goes to a specific section on the same page or a section on a different...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this works OK:
Can be tested here: https://codesandbox.io/s/nervous-elbakyan-2mcxs?file=/pages/_app.js
I wouldn’t call this intuitive though.
bump for the stale bot