Menubar
Render a visually persistent menu similar to those found near the top of the window in desktop apps. This component is based on the WAI-ARIA Menubar Pattern.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
import {} from "./menu.tsx";import "./style.css";export default function Example() {return (FileEditView);}import {} from "./menu.tsx";import "./style.css";export default function Example() {return (FileEditView);}
Examples
API
Can I use Menubar for site navigation?
Short answer: Yes, but be mindful. Check out the Navigation Menubar example.
ARIA doesn't specify how you should structure the contents of your site. It just describes how the roles should behave. If you've designed your site navigation to work precisely like a menubar and it's clear to the user, then you can use Menubar
.
Using ARIA roles is like signing a contract with the user. You're saying, "I'm going to use this role to represent this thing, and you can expect it to work like this". If you don't follow through, you're breaking that contract, and the user will be confused.
In the case of the menubar
role, the user expects being able to use arrow keys to navigate between menu items. Ariakit provides this behavior out of the box.