Skip to main content

AriaSubMenu

type AriaSubMenu = object &
| {
items: AriaMenuItem[];
content?: never;
}
| {
content: React.ReactNode | (helpers) => React.ReactNode;
items?: never;
};

A submenu that opens in place inside an AriaMenu when its parent item is clicked. A submenu can either render a nested list of AriaMenuItem (which can themselves open further submenus) or arbitrary React content. When a submenu is open, a back button is rendered at the top of the menu to return to the previous level.

Type Declaration​

NameTypeDescription
title?React.ReactNodeOptional title shown next to the back button at the top of the submenu.
titleTestId?stringThe test id applied to the submenu title.
testId?stringThe test id applied to the submenu container.
backButtonLabel?stringAria label for the back button rendered at the top of the submenu. Overrides the menu-level backButtonLabel.
backButtonTestId?stringThe test id for the back button rendered at the top of the submenu.