The positioning is done every time the menu opens, but you can trigger the re-position, for example, on windows resizing, by calling the `jxui-popover/setPosition(menu)` function. ## Styling states | CSS selector | Description | ----------------------- | -------------- | `.ui-menu` | Every menu has this class | `.ui-menu:popover-open` | This pseudo-class matches only menus that are currently being shown | `::backdrop` | This pseudo-element is a full-screen element placed directly behind showing menu elements in the top layer, allowing effects to be added to the page content behind the menu(s) if desired. You might for example want to blur out the content behind the menu to help focus the user's attention on it To animate a menu, follow the [Animating popovers section](/headless/popover#animating-popovers) in the Popover page. ## Component arguments ### MenuButton | Argument | Type | Default | Description | --------------- | --------- | ---------- | -------------- | `target` | `str` | | Required. The ID of the linked `Popover` component. | `action` | `str` | `"toggle"` | `"open"`, `"close"`, or `"toggle"`. | `tag` | `str` | `"button"` | HTML tag of the component. ### Menu | Argument | Type | Default | Description | ------------ | ----- | -------- | -------------- | `mode` | `str` | `"auto"` | `"auto"` or `"manual"`. | `anchor` | `str` | | ID of the element used as an anchor | `anchor-to` | `str` | | Which side/position of the anchor to use: "**top**", "**bottom**", "**right**", or "**left**"; with an optional postfix of "**start**", "**end**", "**center**". | `tag` | `str` | `"div"` | HTML tag of the component. ### MenuItem | Argument | Type | Default | Description | ------------ | ----- | -------- | -------------- | `mode` | `str` | `"auto"` | `"auto"` or `"manual"`. ### MenuSubItem | Argument | Type | Default | Description | ------------ | ----- | -------- | -------------- | `mode` | `str` | `"auto"` | `"auto"` or `"manual"`. ## Accessibility notes ### Mouse interaction - Clicking a `PopButton` will trigger the button action (open, close, or toggle state). - Clicking outside of a `Popover` will close *all* the `Popover` with `mode="auto"`. ### Keyboard interaction - Pressing the Enter or Space keys on a `PopButton` will trigger the button action (open, close, or toggle state), and close *all* the `Popover` with `mode="auto"`. - Pressing the Escape key will close *all* the `Popover` with `mode="auto"`.