# SubmenuPopover (TSX) ## Description The `SubmenuPopover` component is used to render a popover menu with a submenu. ## Table of contents ## How to use ```tsx import '@wordpress/components/build-style/style.css'; import { DropdownMenu, Icon, MenuGroup, MenuItem } from '@wordpress/components'; import { chevronRight } from '@wordpress/icons'; import SubmenuPopover, { useSubmenuPopoverProps } from '.'; export const Menu = () => { const submenu = useSubmenuPopoverProps(); const secondSubmenu = useSubmenuPopoverProps(); return ( { () => ( Item 1
Item 2 Item 2.1 Item 2.2 Item 2.4
Item 3
) }
); }; ``` ## Props The following props are available. Note that `children` is required. All the props needed are generated by the hook `useSubmenuPopoverProps`. - `children`: (React.ReactNode) The content of the SubmenuPopover. - `isVisible`: (boolean) if the submenu should be visible or not. - `...rest`: (object) Any other props to be passed to the @wordpress/components `Popover`.