---
id: "packages/active-ui/menubar"
title: "Menubar"
description: "A bar of menus, as in a desktop application, where one open menu leads to the next."
url: "/packages/active-ui/menubar"
locale: "en"
revision: "08049be04f4a973b"
---

# Menubar

A menubar puts several menus side by side, as the File, Edit and View menus of a desktop
application. Use it for a tool with many commands, such as an editor; for the actions of one
object, a single [dropdown menu](/packages/active-ui/dropdown-menu) is enough, and for moving
between pages, a [navigation menu](/packages/active-ui/navigation-menu).

**Example: File, Edit and View**

Client: Runs entirely in your browser. Source: `examples/ui/menubar.tsx`.

```tsx
// apps/docs/examples/ui/menubar.tsx
'use client';

import {useState} from 'react';

import {
  Menubar,
  MenubarCheckboxItem,
  MenubarContent,
  MenubarItem,
  MenubarMenu,
  MenubarRadioGroup,
  MenubarRadioItem,
  MenubarSeparator,
  MenubarSub,
  MenubarSubContent,
  MenubarSubTrigger,
  MenubarTrigger,
} from '@workspace/active-ui/components/primitives/menubar';

/**
 * The menus of an editor-like screen in one bar. With one menu open, moving
 * the pointer or the arrow keys to the next title opens that menu instead.
 */
export default function MenubarExample() {
  const [last, setLast] = useState('nothing yet');
  const [grid, setGrid] = useState(true);
  const [density, setDensity] = useState('comfortable');
  return (
    <div className="flex flex-col items-center gap-4">
      <Menubar aria-label="Report editor">
        <MenubarMenu>
          <MenubarTrigger>File</MenubarTrigger>
          <MenubarContent>
            <MenubarItem onClick={() => setLast('New report')}>
              New report
            </MenubarItem>
            <MenubarItem onClick={() => setLast('Duplicate')}>
              Duplicate
            </MenubarItem>
            <MenubarSub>
              <MenubarSubTrigger>Export</MenubarSubTrigger>
              <MenubarSubContent>
                <MenubarItem onClick={() => setLast('Export as CSV')}>
                  CSV
                </MenubarItem>
                <MenubarItem onClick={() => setLast('Export as PDF')}>
                  PDF
                </MenubarItem>
              </MenubarSubContent>
            </MenubarSub>
            <MenubarSeparator />
            <MenubarItem disabled>Print (not available)</MenubarItem>
          </MenubarContent>
        </MenubarMenu>
        <MenubarMenu>
          <MenubarTrigger>Edit</MenubarTrigger>
          <MenubarContent>
            <MenubarItem onClick={() => setLast('Undo')}>Undo</MenubarItem>
            <MenubarItem onClick={() => setLast('Redo')}>Redo</MenubarItem>
          </MenubarContent>
        </MenubarMenu>
        <MenubarMenu>
          <MenubarTrigger>View</MenubarTrigger>
          <MenubarContent>
            <MenubarCheckboxItem checked={grid} onCheckedChange={setGrid}>
              Show grid lines
            </MenubarCheckboxItem>
            <MenubarSeparator />
            <MenubarRadioGroup value={density} onValueChange={setDensity}>
              <MenubarRadioItem value="comfortable">
                Comfortable
              </MenubarRadioItem>
              <MenubarRadioItem value="compact">Compact</MenubarRadioItem>
            </MenubarRadioGroup>
          </MenubarContent>
        </MenubarMenu>
      </Menubar>
      <p className="text-muted-foreground text-sm" aria-live="polite">
        Last action: {last} · grid {grid ? 'on' : 'off'} · {density}
      </p>
    </div>
  );
}
```

## Usage

```tsx
import {
  Menubar,
  MenubarContent,
  MenubarItem,
  MenubarMenu,
  MenubarTrigger,
} from '@workspace/active-ui/components/primitives/menubar';

<Menubar aria-label="Report editor">
  <MenubarMenu>
    <MenubarTrigger>File</MenubarTrigger>
    <MenubarContent>
      <MenubarItem onClick={create}>New report</MenubarItem>
    </MenubarContent>
  </MenubarMenu>
</Menubar>;
```

## Anatomy

- `Menubar`: the bar, `role="menubar"`.
- `MenubarMenu`: one menu, with its `MenubarTrigger` (the title) and `MenubarContent`.
- Inside a menu: `MenubarItem` (`variant`, `inset`), `MenubarCheckboxItem`, `MenubarRadioGroup`
  with `MenubarRadioItem`, `MenubarGroup` with `MenubarLabel`, `MenubarSub` with its trigger and
  content, `MenubarSeparator` and `MenubarShortcut`: as in the dropdown menu.

## What your application provides

- A name for the bar (`aria-label`), and the titles and items of its menus.
- What each item does. A shortcut only shows a key; binding it is your application's work.

## Accessibility and keyboard

- The bar is one tab stop. `←` and `→` move between the titles; `↓`, `Enter` or `Space` opens a
  menu.
- With a menu open, `←` and `→` move to the neighbouring menu and open it; the pointer does the
  same when it moves to another title.
- Inside a menu the keys of the dropdown menu apply; `Escape` closes it and returns the focus to
  its title.

## API

### Menubar

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | no | Whether the whole menubar is disabled. |
| `loopFocus` | `boolean` | no | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. |
| `modal` | `boolean` | no | Whether the menubar is modal. |
| `orientation` | `MenuRootOrientation` | no | The orientation of the menubar. |
| `render` | `ComponentRenderFn<HTMLProps, MenubarState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

### Other parts

**MenubarPortal**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `container` | `HTMLElement \| RefObject<HTMLElement \| ShadowRoot \| null> \| ShadowRoot \| null` | no | A parent element to render the portal element into. |
| `keepMounted` | `boolean` | no | Whether to keep the portal mounted in the DOM while the popup is hidden. |
| `render` | `ComponentRenderFn<HTMLProps, MenuPortalState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarMenu**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `actionsRef` | `RefObject<MenuRootActions \| null>` | no | A ref to imperative actions. - `unmount`: Ends the closing phase of the menu after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the menu completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the menu imperatively when called. |
| `children` | `PayloadChildRenderFunction<unknown> \| ReactNode` | no | The content of the menu. This can be a regular React node or a render function that receives the `payload` of the active trigger. |
| `closeParentOnEsc` | `boolean` | no | When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. |
| `defaultOpen` | `boolean` | no | Whether the menu is initially open.  To render a controlled menu, use the `open` prop instead. |
| `defaultTriggerId` | `string \| null` | no | ID of the trigger that the menu is associated with. This is useful in conjunction with the `defaultOpen` prop to create an initially open menu. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `handle` | `MenuHandle<unknown>` | no | A handle to associate the menu with a trigger. If specified, allows external triggers to control the menu's open state. |
| `highlightItemOnHover` | `boolean` | no | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state. |
| `loopFocus` | `boolean` | no | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. |
| `modal` | `boolean` | no | Determines if the menu enters a modal state when open. - `true`: user interaction is limited to the menu: document page scroll is locked and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed.  On touch devices, a `true` modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior.  Nested menus ignore this prop, and menus opened by hover are never modal. |
| `onItemHighlighted` | `((highlightedItem: HTMLElement \| undefined, eventDetails: MenuRoot.HighlightEventDetails) => void)` | no | Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item element (or `undefined` if no item is highlighted) and details containing the reason for the change, the event, and the item's text label. The `reason` can be: - `'keyboard'`: the highlight changed due to keyboard navigation. - `'pointer'`: the highlight changed due to pointer hovering. The event may be a `MouseEvent` rather than a `PointerEvent`. - `'none'`: the highlight changed for another reason, such as automatic highlighting while filtering, the item list changing, or the popup opening or closing. |
| `onOpenChange` | `((open: boolean, eventDetails: MenuRoot.ChangeEventDetails) => void)` | no | Event handler called when the menu is opened or closed. |
| `onOpenChangeComplete` | `((open: boolean) => void)` | no | Event handler called after any animations complete when the menu is opened or closed. |
| `open` | `boolean` | no | Whether the menu is currently open. |
| `orientation` | `MenuRootOrientation` | no | The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. |
| `triggerId` | `string \| null` | no | ID of the trigger that the menu is associated with. This is useful in conjunction with the `open` prop to create a controlled menu. There's no need to specify this prop when the menu is uncontrolled (that is, when the `open` prop is not set). |

**MenubarTrigger**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | no |  |
| `closeDelay` | `number` | no | How long to wait before closing the menu that was opened on hover. Specified in milliseconds.  Requires the `openOnHover` prop. |
| `delay` | `number` | no | How long to wait before the menu may be opened on hover. Specified in milliseconds.  Requires the `openOnHover` prop. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `handle` | `MenuHandle<unknown>` | no | A handle to associate the trigger with a menu. |
| `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`). |
| `openOnHover` | `boolean` | no | Whether the menu should also open when the trigger is hovered. |
| `payload` | `unknown` | no | A payload to pass to the menu when it is opened. |
| `render` | `ComponentRenderFn<HTMLProps, MenuTriggerState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarContent**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `align` | `Align` | no | How to align the popup relative to the specified side.  Submenus and menubars default to `'start'`. |
| `alignOffset` | `number \| OffsetFunction` | no | Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment.  The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |
| `children` | `ReactNode` | no |  |
| `finalFocus` | `boolean \| RefObject<HTMLElement \| null> \| ((closeType: InteractionType) => boolean \| HTMLElement \| null \| void)` | no | Determines the element to focus when the menu is closed.  - `false`: Do not move focus. - `true`: Move focus based on the default behavior (trigger or previously focused element). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing. |
| `id` | `string` | no |  |
| `render` | `ComponentRenderFn<HTMLProps, MenuPopupState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |
| `side` | `Side` | no | Which side of the anchor element to align the popup against. May automatically change to avoid collisions.  Submenus and vertical menubars default to `'inline-end'`. |
| `sideOffset` | `number \| OffsetFunction` | no | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment.  The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |

**MenubarGroup**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | no | The content of the component. |
| `render` | `ComponentRenderFn<HTMLProps, MenuGroupState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarSeparator**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `orientation` | `Orientation` | no | The orientation of the separator. |
| `render` | `ComponentRenderFn<HTMLProps, SeparatorState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarLabel**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | no | Indents the text to line up with items that have an icon or indicator. |
| `render` | `ComponentRenderFn<HTMLProps, MenuGroupLabelState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarItem**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | no | Indents the text to line up with items that have an icon or indicator. |
| `variant` | `"default" \| "destructive"` | no | `destructive` colours an item that deletes or cannot be undone. |
| `closeOnClick` | `boolean` | no | Whether to close the menu when the item is clicked. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `id` | `string` | no |  |
| `label` | `string` | no | Overrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided. |
| `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button. |
| `onClick` | `((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void)` | no | The click handler for the menu item. |
| `render` | `ComponentRenderFn<HTMLProps, MenuItemState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarShortcut**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |

MenubarShortcut has no props of its own.

**MenubarCheckboxItem**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | no | Indents the text to line up with items that have an icon or indicator. |
| `checked` | `boolean` | no | Whether the checkbox item is currently ticked.  To render an uncontrolled checkbox item, use the `defaultChecked` prop instead. |
| `closeOnClick` | `boolean` | no | Whether to close the menu when the item is clicked. |
| `defaultChecked` | `boolean` | no | Whether the checkbox item is initially ticked.  To render a controlled checkbox item, use the `checked` prop instead. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `id` | `string` | no |  |
| `label` | `string` | no | Overrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided. |
| `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button. |
| `onCheckedChange` | `((checked: boolean, eventDetails: MenuCheckboxItem.ChangeEventDetails) => void)` | no | Event handler called when the checkbox item is ticked or unticked. |
| `onClick` | `((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void)` | no | The click handler for the menu item. |
| `render` | `ComponentRenderFn<HTMLProps, MenuCheckboxItemState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarRadioGroup**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | no | The content of the component. |
| `defaultValue` | `any` | no | The uncontrolled value of the radio item that should be initially selected.  To render a controlled radio group, use the `value` prop instead. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `onValueChange` | `((value: any, eventDetails: MenuRadioGroup.ChangeEventDetails) => void)` | no | Function called when the selected value changes. |
| `render` | `ComponentRenderFn<HTMLProps, MenuRadioGroupState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |
| `value` | `any` | no | The controlled value of the radio item that should be currently selected.  To render an uncontrolled radio group, use the `defaultValue` prop instead. |

**MenubarRadioItem**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | no | Indents the text to line up with items that have an icon or indicator. |
| `value` | `any` | yes | Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected. |
| `closeOnClick` | `boolean` | no | Whether to close the menu when the item is clicked. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `id` | `string` | no |  |
| `label` | `string` | no | Overrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided. |
| `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button. |
| `onClick` | `((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void)` | no | The click handler for the menu item. |
| `render` | `ComponentRenderFn<HTMLProps, MenuRadioItemState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarSub**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `actionsRef` | `RefObject<MenuRootActions \| null>` | no | A ref to imperative actions. - `unmount`: Ends the closing phase of the menu after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the menu completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the menu imperatively when called. |
| `children` | `ReactNode` | no | The content of the submenu. |
| `closeParentOnEsc` | `boolean` | no | When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. |
| `defaultOpen` | `boolean` | no | Whether the menu is initially open.  To render a controlled menu, use the `open` prop instead. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `highlightItemOnHover` | `boolean` | no | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state. |
| `loopFocus` | `boolean` | no | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. |
| `onItemHighlighted` | `((highlightedItem: HTMLElement \| undefined, eventDetails: MenuRoot.HighlightEventDetails) => void)` | no | Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item element (or `undefined` if no item is highlighted) and details containing the reason for the change, the event, and the item's text label. The `reason` can be: - `'keyboard'`: the highlight changed due to keyboard navigation. - `'pointer'`: the highlight changed due to pointer hovering. The event may be a `MouseEvent` rather than a `PointerEvent`. - `'none'`: the highlight changed for another reason, such as automatic highlighting while filtering, the item list changing, or the popup opening or closing. |
| `onOpenChange` | `((open: boolean, eventDetails: MenuSubmenuRoot.ChangeEventDetails) => void)` | no | Event handler called when the menu is opened or closed. |
| `onOpenChangeComplete` | `((open: boolean) => void)` | no | Event handler called after any animations complete when the menu is opened or closed. |
| `open` | `boolean` | no | Whether the menu is currently open. |
| `orientation` | `MenuRootOrientation` | no | The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. |

**MenubarSubTrigger**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` | no | Indents the text to line up with items that have an icon or indicator. |
| `closeDelay` | `number` | no | How long to wait before closing the menu that was opened on hover. Specified in milliseconds.  Requires the `openOnHover` prop. |
| `delay` | `number` | no | How long to wait before the menu may be opened on hover. Specified in milliseconds.  Requires the `openOnHover` prop. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `id` | `string` | no |  |
| `label` | `string` | no | Overrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided. |
| `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button. |
| `onClick` | `((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void)` | no |  |
| `openOnHover` | `boolean` | no | Whether the menu should also open when the trigger is hovered. |
| `render` | `ComponentRenderFn<HTMLProps, MenuSubmenuTriggerState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**MenubarSubContent**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `align` | `Align` | no | How to align the popup relative to the specified side.  Submenus and menubars default to `'start'`. |
| `alignOffset` | `number \| OffsetFunction` | no | Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment.  The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |
| `children` | `ReactNode` | no |  |
| `finalFocus` | `boolean \| RefObject<HTMLElement \| null> \| ((closeType: InteractionType) => boolean \| HTMLElement \| null \| void)` | no | Determines the element to focus when the menu is closed.  - `false`: Do not move focus. - `true`: Move focus based on the default behavior (trigger or previously focused element). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing. |
| `id` | `string` | no |  |
| `render` | `ComponentRenderFn<HTMLProps, MenuPopupState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |
| `side` | `Side` | no | Which side of the anchor element to align the popup against. May automatically change to avoid collisions.  Submenus and vertical menubars default to `'inline-end'`. |
| `sideOffset` | `number \| OffsetFunction` | no | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment.  The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |

> [!NOTE]
> **Based on shadcn/ui**
>
> This page adapts the Menubar documentation of shadcn/ui (MIT licence) to this
> package; see [Third-party notices](/third-party-notices).
