Components

菜单栏

¥Menu Bar

桌面应用中常见的视觉持久菜单,可快速访问一组一致的命令。

import * as React from "react";
import { Menubar } from "radix-ui";
import { CheckIcon, ChevronRightIcon, DotFilledIcon, } from "@radix-ui/react-icons";
import "./styles.css";
const RADIO_ITEMS = ["Andy", "Benoît", "Luis"];
const CHECK_ITEMS = ["Always Show Bookmarks Bar", "Always Show Full URLs"];
const MenubarDemo = () => {
const [checkedSelection, setCheckedSelection] = React.useState([
CHECK_ITEMS[1],
]);
const [radioSelection, setRadioSelection] = React.useState(RADIO_ITEMS[2]);
return (
<Menubar.Root className="MenubarRoot">
<Menubar.Menu>
<Menubar.Trigger className="MenubarTrigger">File</Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content className="MenubarContent" align="start" sideOffset={5} alignOffset={-3} >
<Menubar.Item className="MenubarItem">
New Tab <div className="RightSlot">⌘ T</div>
</Menubar.Item>
<Menubar.Item className="MenubarItem">
New Window <div className="RightSlot">⌘ N</div>
</Menubar.Item>
<Menubar.Item className="MenubarItem" disabled>
New Incognito Window
</Menubar.Item>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Sub>
<Menubar.SubTrigger className="MenubarSubTrigger">
Share
<div className="RightSlot">
<ChevronRightIcon />
</div>
</Menubar.SubTrigger>
<Menubar.Portal>
<Menubar.SubContent className="MenubarSubContent" alignOffset={-5} >
<Menubar.Item className="MenubarItem">
Email Link
</Menubar.Item>
<Menubar.Item className="MenubarItem">Messages</Menubar.Item>
<Menubar.Item className="MenubarItem">Notes</Menubar.Item>
</Menubar.SubContent>
</Menubar.Portal>
</Menubar.Sub>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem">
Print… <div className="RightSlot">⌘ P</div>
</Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
<Menubar.Menu>
<Menubar.Trigger className="MenubarTrigger">Edit</Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content className="MenubarContent" align="start" sideOffset={5} alignOffset={-3} >
<Menubar.Item className="MenubarItem">
Undo <div className="RightSlot">⌘ Z</div>
</Menubar.Item>
<Menubar.Item className="MenubarItem">
Redo <div className="RightSlot">⇧ ⌘ Z</div>
</Menubar.Item>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Sub>
<Menubar.SubTrigger className="MenubarSubTrigger">
Find
<div className="RightSlot">
<ChevronRightIcon />
</div>
</Menubar.SubTrigger>
<Menubar.Portal>
<Menubar.SubContent className="MenubarSubContent" alignOffset={-5} >
<Menubar.Item className="MenubarItem">
Search the web…
</Menubar.Item>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem">Find…</Menubar.Item>
<Menubar.Item className="MenubarItem">Find Next</Menubar.Item>
<Menubar.Item className="MenubarItem">
Find Previous
</Menubar.Item>
</Menubar.SubContent>
</Menubar.Portal>
</Menubar.Sub>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem">Cut</Menubar.Item>
<Menubar.Item className="MenubarItem">Copy</Menubar.Item>
<Menubar.Item className="MenubarItem">Paste</Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
<Menubar.Menu>
<Menubar.Trigger className="MenubarTrigger">View</Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content className="MenubarContent" align="start" sideOffset={5} alignOffset={-14} >
{CHECK_ITEMS.map((item) => (
<Menubar.CheckboxItem className="MenubarCheckboxItem inset" key={item} checked={checkedSelection.includes(item)} onCheckedChange={() => setCheckedSelection((current) => current.includes(item) ? current.filter((el) => el !== item) : current.concat(item), ) } >
<Menubar.ItemIndicator className="MenubarItemIndicator">
<CheckIcon />
</Menubar.ItemIndicator>
{item}
</Menubar.CheckboxItem>
))}
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem inset">
Reload <div className="RightSlot">⌘ R</div>
</Menubar.Item>
<Menubar.Item className="MenubarItem inset" disabled>
Force Reload <div className="RightSlot">⇧ ⌘ R</div>
</Menubar.Item>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem inset">
Toggle Fullscreen
</Menubar.Item>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem inset">
Hide Sidebar
</Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
<Menubar.Menu>
<Menubar.Trigger className="MenubarTrigger">Profiles</Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content className="MenubarContent" align="start" sideOffset={5} alignOffset={-14} >
<Menubar.RadioGroup value={radioSelection} onValueChange={setRadioSelection} >
{RADIO_ITEMS.map((item) => (
<Menubar.RadioItem className="MenubarRadioItem inset" key={item} value={item} >
<Menubar.ItemIndicator className="MenubarItemIndicator">
<DotFilledIcon />
</Menubar.ItemIndicator>
{item}
</Menubar.RadioItem>
))}
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem inset">Edit…</Menubar.Item>
<Menubar.Separator className="MenubarSeparator" />
<Menubar.Item className="MenubarItem inset">
Add Profile…
</Menubar.Item>
</Menubar.RadioGroup>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);
};
export default MenubarDemo;

Features

    Can be controlled or uncontrolled.

    Supports submenus with configurable reading direction.

    Supports items, labels, groups of items.

    Supports checkable items (single or multiple).

    Customize side, alignment, offsets, collision handling.

    Optionally render a pointing arrow.

    Focus is fully managed.

    Full keyboard navigation.

    Typeahead support.

安装

¥Installation

从命令行安装组件。

¥Install the component from your command line.

npm install @radix-ui/react-menubar

结构

¥Anatomy

导入所有部分并将它们组合在一起。

¥Import all parts and piece them together.

import { Menubar } from "radix-ui";
export default () => (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger />
<Menubar.Portal>
<Menubar.Content>
<Menubar.Label />
<Menubar.Item />
<Menubar.Group>
<Menubar.Item />
</Menubar.Group>
<Menubar.CheckboxItem>
<Menubar.ItemIndicator />
</Menubar.CheckboxItem>
<Menubar.RadioGroup>
<Menubar.RadioItem>
<Menubar.ItemIndicator />
</Menubar.RadioItem>
</Menubar.RadioGroup>
<Menubar.Sub>
<Menubar.SubTrigger />
<Menubar.Portal>
<Menubar.SubContent />
</Menubar.Portal>
</Menubar.Sub>
<Menubar.Separator />
<Menubar.Arrow />
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);

API 参考

¥API Reference

¥Root

包含菜单栏的所有部分。

¥Contains all the parts of a menubar.

PropTypeDefault
asChild
boolean
false
defaultValue
string
No default value
value
string
No default value
onValueChange
function
No default value
dir
enum
No default value
loop
boolean
false

菜单

¥Menu

顶层菜单项,包含触发器及其内容组合。

¥A top level menu item, contains a trigger with content combination.

PropTypeDefault
asChild
boolean
false
value
string
No default value

触发器

¥Trigger

切换内容的按钮。默认情况下,Menubar.Content 将根据触发器进行定位。

¥The button that toggles the content. By default, the Menubar.Content will position itself against the trigger.

PropTypeDefault
asChild
boolean
false
Data attributeValues
[data-state]"open" | "closed"
[data-highlighted]

Present when highlighted

[data-disabled]

Present when disabled

门户

¥Portal

使用时,将内容部分传送到 body 中。

¥When used, portals the content part into the body.

PropTypeDefault
forceMount
boolean
No default value
container
HTMLElement
document.body

内容

¥Content

在菜单打开时弹出的组件。

¥The component that pops out when a menu is open.

PropTypeDefault
asChild
boolean
false
loop
boolean
false
onCloseAutoFocus
function
No default value
onEscapeKeyDown
function
No default value
onPointerDownOutside
function
No default value
onFocusOutside
function
No default value
onInteractOutside
function
No default value
forceMount
boolean
No default value
side
enum
"bottom"
sideOffset
number
0
align
enum
"center"
alignOffset
number
0
avoidCollisions
boolean
true
collisionBoundary
Boundary
[]
collisionPadding
number | Padding
0
arrowPadding
number
0
sticky
enum
"partial"
hideWhenDetached
boolean
false
Data attributeValues
[data-state]"open" | "closed"
[data-side]"left" | "right" | "bottom" | "top"
[data-align]"start" | "end" | "center"
CSS VariableDescription
--radix-menubar-content-transform-originThe transform-origin computed from the content and arrow positions/offsets
--radix-menubar-content-available-widthThe remaining width between the trigger and the boundary edge
--radix-menubar-content-available-heightThe remaining height between the trigger and the boundary edge
--radix-menubar-trigger-widthThe width of the trigger
--radix-menubar-trigger-heightThe height of the trigger

箭头

¥Arrow

一个可选的箭头元素,用于与菜单栏菜单一起渲染。这可以用来帮助在视觉上将触发器与 Menubar.Content 链接起来。必须在 Menubar.Content 中渲染。

¥An optional arrow element to render alongside a menubar menu. This can be used to help visually link the trigger with the Menubar.Content. Must be rendered inside Menubar.Content.

PropTypeDefault
asChild
boolean
false
width
number
10
height
number
5

项目

¥Item

包含菜单栏项的组件。

¥The component that contains the menubar items.

PropTypeDefault
asChild
boolean
false
disabled
boolean
No default value
onSelect
function
No default value
textValue
string
No default value
Data attributeValues
[data-highlighted]

Present when highlighted

[data-disabled]

Present when disabled

¥Group

用于对多个 Menubar.Item 进行分组。

¥Used to group multiple Menubar.Items.

PropTypeDefault
asChild
boolean
false

标签

¥Label

用于渲染标签。它无法通过方向键获得焦点。

¥Used to render a label. It won't be focusable using arrow keys.

PropTypeDefault
asChild
boolean
false

CheckboxItem

可以像复选框一样控制和渲染的项目。

¥An item that can be controlled and rendered like a checkbox.

PropTypeDefault
asChild
boolean
false
checked
boolean | 'indeterminate'
No default value
onCheckedChange
function
No default value
disabled
boolean
No default value
onSelect
function
No default value
textValue
string
No default value
Data attributeValues
[data-state]"checked" | "unchecked"
[data-highlighted]

Present when highlighted

[data-disabled]

Present when disabled

RadioGroup

用于对多个 Menubar.RadioItem 进行分组。

¥Used to group multiple Menubar.RadioItems.

PropTypeDefault
asChild
boolean
false
value
string
No default value
onValueChange
function
No default value

RadioItem

可以像单选按钮一样控制和渲染的项目。

¥An item that can be controlled and rendered like a radio.

PropTypeDefault
asChild
boolean
false
value*
string
No default value
disabled
boolean
No default value
onSelect
function
No default value
textValue
string
No default value
Data attributeValues
[data-state]"checked" | "unchecked"
[data-highlighted]

Present when highlighted

[data-disabled]

Present when disabled

ItemIndicator

当父级 Menubar.CheckboxItemMenubar.RadioItem 被选中时渲染。你可以直接设置此元素的样式,也可以将其用作封装器来放置图标,或者两者兼而有之。

¥Renders when the parent Menubar.CheckboxItem or Menubar.RadioItem is checked. You can style this element directly, or you can use it as a wrapper to put an icon into, or both.

PropTypeDefault
asChild
boolean
false
forceMount
boolean
No default value
Data attributeValues
[data-state]"checked" | "unchecked"

分隔符

¥Separator

用于在菜单栏菜单中以视觉方式分隔项目。

¥Used to visually separate items in a menubar menu.

PropTypeDefault
asChild
boolean
false

Sub

包含子菜单的所有部分。

¥Contains all the parts of a submenu.

PropTypeDefault
defaultOpen
boolean
No default value
open
boolean
No default value
onOpenChange
function
No default value

SubTrigger

打开子菜单的项目。必须在 Menubar.Sub 中渲染。

¥An item that opens a submenu. Must be rendered inside Menubar.Sub.

PropTypeDefault
asChild
boolean
false
disabled
boolean
No default value
textValue
string
No default value
Data attributeValues
[data-state]"open" | "closed"
[data-highlighted]

Present when highlighted

[data-disabled]

Present when disabled

SubContent

在子菜单打开时弹出的组件。必须在 Menubar.Sub 中渲染。

¥The component that pops out when a submenu is open. Must be rendered inside Menubar.Sub.

PropTypeDefault
asChild
boolean
false
loop
boolean
false
onEscapeKeyDown
function
No default value
onPointerDownOutside
function
No default value
onFocusOutside
function
No default value
onInteractOutside
function
No default value
forceMount
boolean
No default value
sideOffset
number
0
alignOffset
number
0
avoidCollisions
boolean
true
collisionBoundary
Boundary
[]
collisionPadding
number | Padding
0
arrowPadding
number
0
sticky
enum
"partial"
hideWhenDetached
boolean
false
Data attributeValues
[data-state]"open" | "closed"
[data-side]"left" | "right" | "bottom" | "top"
[data-align]"start" | "end" | "center"
[data-orientation]"vertical" | "horizontal"
CSS VariableDescription
--radix-menubar-content-transform-originThe transform-origin computed from the content and arrow positions/offsets
--radix-menubar-content-available-widthThe remaining width between the trigger and the boundary edge
--radix-menubar-content-available-heightThe remaining height between the trigger and the boundary edge
--radix-menubar-trigger-widthThe width of the trigger
--radix-menubar-trigger-heightThe height of the trigger

示例

¥Examples

与子菜单一起使用

¥With submenus

你可以将 Menubar.Sub 及其各个部分结合使用来创建子菜单。

¥You can create submenus by using Menubar.Sub in combination with its parts.

<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content>
<Menubar.Item></Menubar.Item>
<Menubar.Item></Menubar.Item>
<Menubar.Separator />
<Menubar.Sub>
<Menubar.SubTrigger>Sub menu →</Menubar.SubTrigger>
<Menubar.Portal>
<Menubar.SubContent>
<Menubar.Item>Sub menu item</Menubar.Item>
<Menubar.Item>Sub menu item</Menubar.Item>
<Menubar.Arrow />
</Menubar.SubContent>
</Menubar.Portal>
</Menubar.Sub>
<Menubar.Separator />
<Menubar.Item></Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>

使用禁用元素

¥With disabled items

你可以通过 data-disabled 属性为禁用项目添加特殊样式。

¥You can add special styles to disabled items via the data-disabled attribute.

// index.jsx
import { Menubar } from "radix-ui";
import "./styles.css";
export default () => (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content>
<Menubar.Item className="MenubarItem" disabled>
</Menubar.Item>
<Menubar.Item className="MenubarItem"></Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);
/* styles.css */
.MenubarItem[data-disabled] {
color: gainsboro;
}

与分隔符一起使用

¥With separators

使用 Separator 组件在项目之间添加分隔符。

¥Use the Separator part to add a separator between items.

<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content>
<Menubar.Item></Menubar.Item>
<Menubar.Separator />
<Menubar.Item></Menubar.Item>
<Menubar.Separator />
<Menubar.Item></Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>

使用标签

¥With labels

使用 Label 组件帮助标记某个部分。

¥Use the Label part to help label a section.

<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content>
<Menubar.Label>Label</Menubar.Label>
<Menubar.Item></Menubar.Item>
<Menubar.Item></Menubar.Item>
<Menubar.Item></Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>

使用复选框

¥With checkbox items

使用 CheckboxItem 组件添加可勾选的项目。

¥Use the CheckboxItem part to add an item that can be checked.

import * as React from "react";
import { CheckIcon } from "@radix-ui/react-icons";
import { Menubar } from "radix-ui";
export default () => {
const [checked, setChecked] = React.useState(true);
return (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content>
<Menubar.Item></Menubar.Item>
<Menubar.Item></Menubar.Item>
<Menubar.Separator />
<Menubar.CheckboxItem checked={checked} onCheckedChange={setChecked} >
<Menubar.ItemIndicator>
<CheckIcon />
</Menubar.ItemIndicator>
Checkbox item
</Menubar.CheckboxItem>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);
};

与单选按钮一起使用

¥With radio items

使用 RadioGroupRadioItem 部件添加一个可在众多选项中勾选的项目。

¥Use the RadioGroup and RadioItem parts to add an item that can be checked amongst others.

import * as React from "react";
import { CheckIcon } from "@radix-ui/react-icons";
import { Menubar } from "radix-ui";
export default () => {
const [color, setColor] = React.useState("blue");
return (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content>
<Menubar.RadioGroup value={color} onValueChange={setColor}>
<Menubar.RadioItem value="red">
<Menubar.ItemIndicator>
<CheckIcon />
</Menubar.ItemIndicator>
Red
</Menubar.RadioItem>
<Menubar.RadioItem value="blue">
<Menubar.ItemIndicator>
<CheckIcon />
</Menubar.ItemIndicator>
Blue
</Menubar.RadioItem>
</Menubar.RadioGroup>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);
};

使用复杂元素

¥With complex items

你可以在 Item 部件中添加额外的装饰元素,例如图片。

¥You can add extra decorative elements in the Item parts, such as images.

import { Menubar } from "radix-ui";
export default () => (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content>
<Menubar.Item>
<img src="" />
Adolfo Hess
</Menubar.Item>
<Menubar.Item>
<img src="" />
Miyah Myles
</Menubar.Item>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);

限制内容/子内容大小

¥Constrain the content/sub-content size

你可能需要限制内容(或子内容)的宽度,使其与触发器(或子触发器)的宽度匹配。你可能还需要限制其高度,使其不超过视口。

¥You may want to constrain the width of the content (or sub-content) so that it matches the trigger (or sub-trigger) width. You may also want to constrain its height to not exceed the viewport.

为了支持此功能,我们公开了几个 CSS 自定义属性,例如 --radix-menubar-trigger-width--radix-menubar-content-available-height。使用它们来限制内容尺寸。

¥We expose several CSS custom properties such as --radix-menubar-trigger-width and --radix-menubar-content-available-height to support this. Use them to constrain the content dimensions.

// index.jsx
import { Menubar } from "radix-ui";
import "./styles.css";
export default () => (
<Menubar.Root>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content className="MenubarContent" sideOffset={5}>
</Menubar.Content>
</Menubar.Portal>
</Menubar.Root>
);
/* styles.css */
.MenubarContent {
width: var(--radix-menubar-trigger-width);
max-height: var(--radix-menubar-content-available-height);
}

原点感知动画

¥Origin-aware animations

我们公开了一个 CSS 自定义属性 --radix-menubar-content-transform-origin。使用它来根据 sidesideOffsetalignalignOffset 以及任何碰撞,从其计算出的原点为内容设置动画。

¥We expose a CSS custom property --radix-menubar-content-transform-origin. Use it to animate the content from its computed origin based on side, sideOffset, align, alignOffset and any collisions.

// index.jsx
import { Menubar } from "radix-ui";
import "./styles.css";
export default () => (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content className="MenubarContent"></Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);
/* styles.css */
.MenubarContent {
transform-origin: var(--radix-menubar-content-transform-origin);
animation: scaleIn 0.5s ease-out;
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0);
}
to {
opacity: 1;
transform: scale(1);
}
}

碰撞感知动画

¥Collision-aware animations

我们公开了 data-sidedata-align 属性。它们的值将在运行时更改以反映碰撞。使用它们来创建碰撞和方向感知动画。

¥We expose data-side and data-align attributes. Their values will change at runtime to reflect collisions. Use them to create collision and direction-aware animations.

// index.jsx
import { Menubar } from "radix-ui";
import "./styles.css";
export default () => (
<Menubar.Root>
<Menubar.Menu>
<Menubar.Trigger></Menubar.Trigger>
<Menubar.Portal>
<Menubar.Content className="MenubarContent"></Menubar.Content>
</Menubar.Portal>
</Menubar.Menu>
</Menubar.Root>
);
/* styles.css */
.MenubarContent {
animation-duration: 0.6s;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
.MenubarContent[data-side="top"] {
animation-name: slideUp;
}
.MenubarContent[data-side="bottom"] {
animation-name: slideDown;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

可访问性

¥Accessibility

遵循 菜单按钮 WAI-ARIA 设计模式 并使用 移动 tabindex 管理菜单项之间的焦点移动。

¥Adheres to the Menu Button WAI-ARIA design pattern and uses roving tabindex to manage focus movement among menu items.

键盘交互

¥Keyboard Interactions

KeyDescription
Space
When focus is on Menubar.Trigger, opens the menubar and focuses the first item.
When focus is on an item, activates the focused item.
Enter
When focus is on Menubar.Trigger, opens the associated menu.
When focus is on an item, activates the focused item.
ArrowDown
When focus is on Menubar.Trigger, opens the associated menu.
When focus is on an item, moves focus to the next item.
ArrowUp
When focus is on an item, moves focus to the previous item.
ArrowRightArrowLeft
When focus is on a Menubar.Trigger, moves focus to the next or previous item.
When focus is on a Menubar.SubTrigger, opens or closes the submenu depending on reading direction.
When focus is within a Menubar.Content, opens the next menu in the menubar.
Esc
Closes the currently open menu and moves focus to its Menubar.Trigger.
Previous标签