shadcn.io is an independent project built on shadcn/ui
File opens New File, Open Recent and Save. Open Recent has an arrow and lists Document 1.txt, Document 2.txt and Document 3.txt.
Nest a submenu when a few related commands, such as recent files, would crowd the parent menu. A Command menu is easier once that list gets long. On React, Ark UI does not track recent files.
Installation
Anatomy

Usage
<Menubar>
<MenubarMenu>
<MenubarTrigger>File</MenubarTrigger>
<MenubarContent>
<MenubarItem value="new-file">New File</MenubarItem>
<MenubarSub>
<MenubarSubTrigger>Open Recent</MenubarSubTrigger>
<MenubarSubContent>
<MenubarItem value="document-1-txt">Document 1.txt</MenubarItem>
<MenubarItem value="document-2-txt">Document 2.txt</MenubarItem>
<MenubarItem value="document-3-txt">Document 3.txt</MenubarItem>
</MenubarSubContent>
</MenubarSub>
<MenubarItem value="save">Save</MenubarItem>
</MenubarContent>
</MenubarMenu>
</Menubar>FAQ
How is Open Recent nested?
MenubarSub wraps a MenubarSubTrigger that reads Open Recent and a MenubarSubContent with the documents. The submenu opens beside its trigger and flips to the other side when there's no room.
Where does the arrow on Open Recent come from?
MenubarSubTrigger draws the chevron at the end of the row itself; the demo adds no icon.
What are the rows inside the submenu?
Document 1.txt, Document 2.txt and Document 3.txt, as plain MenubarItems.
API Reference
Menubar
Sets value="new-file", value="document-1-txt", value="document-2-txt", value="document-3-txt" and value="save". The rest is on the Menubar page.





