UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

44 lines (43 loc) 2.06 kB
'use client'; import { withWebComponent } from '@ui5/webcomponents-react-base'; /** * `Menu` component represents a hierarchical menu structure. * * ### Structure * * The `Menu` can hold two types of entities: * * - `MenuItem` components * - `MenuSeparator` - used to separate menu items with a line * * An arbitrary hierarchy structure can be represented by recursively nesting menu items. * * ### Keyboard Handling * * The `Menu` provides advanced keyboard handling. * The user can use the following keyboard shortcuts in order to navigate trough the tree: * * - `Arrow Up` / `Arrow Down` - Navigates up and down the menu items that are currently visible. * - `Arrow Right`, `Space` or `Enter` - Opens a sub-menu if there are menu items nested * in the currently clicked menu item. * - `Arrow Left` or `Escape` - Closes the currently opened sub-menu. * * when there is `endContent` : * - `Arrow Left` or `ArrowRight` - Navigate between the menu item actions and the menu item itself * - `Arrow Up` / `Arrow Down` - Navigates up and down the currently visible menu items * * **Note:** If the text direction is set to Right-to-left (RTL), `Arrow Right` and `Arrow Left` functionality is swapped. * * Application developers are responsible for ensuring that interactive elements placed in the `endContent` slot * have the correct accessibility behaviour, including their enabled or disabled states. * The menu does not manage these aspects when the menu item state changes. * * * * __Note:__ This is a UI5 Web Component! [Menu UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/Menu) | [Repository](https://github.com/UI5/webcomponents) * * @since [1.3.0](https://github.com/UI5/webcomponents/releases/tag/v1.3.0) of __@ui5/webcomponents__. */ const Menu = withWebComponent('ui5-menu', ['headerText', 'horizontalAlign', 'loadingDelay', 'opener', 'placement'], ['loading', 'open'], [], ['before-close', 'before-open', 'close', 'item-click', 'open']); Menu.displayName = 'Menu'; export { Menu };