---
id: "packages/active-ui/dropdown-menu"
title: "DropdownMenu"
description: "A menu of actions and settings behind a button, with groups, checkbox and radio items, submenus and a destructive item."
url: "/packages/active-ui/dropdown-menu"
locale: "en"
revision: "8ac1ad3617b0737c"
---

# DropdownMenu

A dropdown menu opens from a button with a list of actions, such as the actions of a table row, or
settings that apply at once. It is built on Base UI's menu. For a choice that is a form value, use
a [select](/packages/active-ui/select); for actions on a right click, a
[context menu](/packages/active-ui/context-menu).

**Example: Actions, a setting, a choice and a submenu**

Client: Runs entirely in your browser. Source: `examples/ui/dropdown-menu.tsx`.

```tsx
// apps/docs/examples/ui/dropdown-menu.tsx
'use client';

import {useState} from 'react';
import {
  CopyIcon,
  MoreHorizontalIcon,
  PencilIcon,
  Trash2Icon,
} from 'lucide-react';

import {Button} from '@workspace/active-ui/components/primitives/button';
import {
  DropdownMenu,
  DropdownMenuCheckboxItem,
  DropdownMenuContent,
  DropdownMenuGroup,
  DropdownMenuItem,
  DropdownMenuLabel,
  DropdownMenuRadioGroup,
  DropdownMenuRadioItem,
  DropdownMenuSeparator,
  DropdownMenuSub,
  DropdownMenuSubContent,
  DropdownMenuSubTrigger,
  DropdownMenuTrigger,
} from '@workspace/active-ui/components/primitives/dropdown-menu';

/**
 * The actions of one row behind a button: plain items, a setting that is on
 * or off, one choice out of several, a submenu, and a destructive action set
 * apart. What each item did is printed below, because a menu only reports
 * the choice.
 */
export default function DropdownMenuExample() {
  const [last, setLast] = useState('nothing yet');
  const [archived, setArchived] = useState(false);
  const [sort, setSort] = useState('name');
  return (
    <div className="flex flex-col items-center gap-4">
      <DropdownMenu>
        <DropdownMenuTrigger
          render={
            <Button variant="outline" size="icon" aria-label="Scheme actions" />
          }
        >
          <MoreHorizontalIcon aria-hidden />
        </DropdownMenuTrigger>
        <DropdownMenuContent className="w-56">
          <DropdownMenuGroup>
            <DropdownMenuLabel>Pension scheme 2026</DropdownMenuLabel>
            <DropdownMenuItem onClick={() => setLast('Edit')}>
              <PencilIcon aria-hidden />
              Edit
            </DropdownMenuItem>
            <DropdownMenuItem onClick={() => setLast('Duplicate')}>
              <CopyIcon aria-hidden />
              Duplicate
            </DropdownMenuItem>
            <DropdownMenuSub>
              <DropdownMenuSubTrigger>Export as</DropdownMenuSubTrigger>
              <DropdownMenuSubContent>
                <DropdownMenuItem onClick={() => setLast('Export as CSV')}>
                  CSV
                </DropdownMenuItem>
                <DropdownMenuItem onClick={() => setLast('Export as PDF')}>
                  PDF
                </DropdownMenuItem>
              </DropdownMenuSubContent>
            </DropdownMenuSub>
          </DropdownMenuGroup>
          <DropdownMenuSeparator />
          <DropdownMenuCheckboxItem
            checked={archived}
            onCheckedChange={setArchived}
          >
            Show archived versions
          </DropdownMenuCheckboxItem>
          <DropdownMenuSeparator />
          <DropdownMenuGroup>
            <DropdownMenuLabel>Sort participants by</DropdownMenuLabel>
            <DropdownMenuRadioGroup value={sort} onValueChange={setSort}>
              <DropdownMenuRadioItem value="name">Name</DropdownMenuRadioItem>
              <DropdownMenuRadioItem value="joined">
                Date joined
              </DropdownMenuRadioItem>
            </DropdownMenuRadioGroup>
          </DropdownMenuGroup>
          <DropdownMenuSeparator />
          <DropdownMenuItem
            variant="destructive"
            onClick={() => setLast('Delete')}
          >
            <Trash2Icon aria-hidden />
            Delete
          </DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenu>
      <p className="text-muted-foreground text-sm" aria-live="polite">
        Last action: {last} · archived {archived ? 'shown' : 'hidden'} · sorted
        by {sort}
      </p>
    </div>
  );
}
```

## Usage

```tsx
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuTrigger,
} from '@workspace/active-ui/components/primitives/dropdown-menu';

<DropdownMenu>
  <DropdownMenuTrigger render={<Button variant="outline" />}>
    Actions
  </DropdownMenuTrigger>
  <DropdownMenuContent>
    <DropdownMenuItem onClick={edit}>Edit</DropdownMenuItem>
    <DropdownMenuItem variant="destructive" onClick={remove}>
      Delete
    </DropdownMenuItem>
  </DropdownMenuContent>
</DropdownMenu>;
```

## Anatomy

- `DropdownMenu` and `DropdownMenuTrigger`: the open state and the button that opens it.
- `DropdownMenuContent`: the list, placed by `side` (default `bottom`) and `align` (default
  `start`). It is as wide as its trigger, at least `8rem`; set a width with `className`.
- `DropdownMenuItem`: an action, run by `onClick`; the menu closes after it. `variant="destructive"`
  colours an action that deletes. `inset` aligns an item without an icon with items that have one.
- `DropdownMenuCheckboxItem`: a setting that is on or off (`checked`, `onCheckedChange`). The
  menu stays open after it, so several settings can be changed at once.
- `DropdownMenuRadioGroup` with `DropdownMenuRadioItem`: one choice out of several (`value`,
  `onValueChange`).
- `DropdownMenuGroup` with `DropdownMenuLabel`: a labelled group. A label belongs inside a group.
- `DropdownMenuSub` with `DropdownMenuSubTrigger` and `DropdownMenuSubContent`: a submenu.
- `DropdownMenuSeparator` and `DropdownMenuShortcut`. A shortcut only **shows** a key combination;
  binding the keys is your application's work.

## What your application provides

- An accessible name for an icon-only trigger.
- What each item does, and the state of checkbox and radio items.
- A confirmation for a destructive item that cannot be undone, such as an
  [alert dialog](/packages/active-ui/alert-dialog).

## Accessibility and keyboard

- The trigger opens the menu with `Enter`, `Space` or `↓`, and moves the focus to the first item.
- `↓` and `↑` move between items, typing a letter jumps to an item that starts with it, `→` opens
  a submenu and `←` closes it, `Enter` runs the item, and `Escape` closes the menu and returns the
  focus to the trigger.
- The list is a `role="menu"`; items are `menuitem`, `menuitemcheckbox` or `menuitemradio`.

## API

### DropdownMenuContent

| 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. |

### DropdownMenuItem

| 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. |

### Other parts

**DropdownMenu**

| 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). |

**DropdownMenuPortal**

| 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. |

**DropdownMenuTrigger**

| 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. |

**DropdownMenuGroup**

| 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. |

**DropdownMenuLabel**

| 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. |

**DropdownMenuCheckboxItem**

| 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. |

**DropdownMenuRadioGroup**

| 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. |

**DropdownMenuRadioItem**

| 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. |

**DropdownMenuSeparator**

| 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. |

**DropdownMenuShortcut**

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

DropdownMenuShortcut has no props of its own.

**DropdownMenuSub**

| 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. |

**DropdownMenuSubTrigger**

| 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. |

**DropdownMenuSubContent**

| 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 Dropdown Menu documentation of shadcn/ui (MIT licence) to
> this package; see [Third-party notices](/third-party-notices).
