Menu

The Menu component presents a structured list of actions, settings, or navigation targets within a transient surface. It supports icons, keyboard shortcuts, hint text, section titles, dividers, and submenu indicators.

import {Menu} from "@qualcomm-ui/react/menu"

Examples

Item Customization

Compose the menu to include icons and commands.

import type {ReactElement} from "react"

import {Command, File, FileText, FolderOpen, ImageDown} from "lucide-react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Icon} from "@qualcomm-ui/react/icon"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuItemCustomizationDemo(): ReactElement {
  return (
    <Menu.Root>
      <Menu.Trigger>
        <Menu.Button emphasis="primary">Show Menu</Menu.Button>
      </Menu.Trigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="new-text-file">
              <Menu.ItemStartIcon icon={FileText} />
              New Text File
              <Menu.ItemCommand>
                <Icon icon={Command} size="xs" />E
              </Menu.ItemCommand>
            </Menu.Item>
            <Menu.Item value="new-file">
              <Menu.ItemStartIcon icon={File} />
              New File...
              <Menu.ItemCommand>
                <Icon icon={Command} size="xs" />N
              </Menu.ItemCommand>
            </Menu.Item>
            <Menu.Item value="open-file">
              <Menu.ItemStartIcon icon={FolderOpen} />
              Open File...
              <Menu.ItemCommand>
                <Icon icon={Command} size="xs" />O
              </Menu.ItemCommand>
              <Menu.ItemDescription>Optional Description</Menu.ItemDescription>
            </Menu.Item>
            <Menu.Item value="export">
              <Menu.ItemStartIcon icon={ImageDown} />
              Export
              <Menu.ItemCommand>
                <Icon icon={Command} size="xs" />S
              </Menu.ItemCommand>
            </Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Use <Menu.Button> for a labeled trigger and <Menu.IconButton> for an icon-only trigger. Both automatically render a chevron indicator. Always provide an aria-label on <Menu.IconButton> to give assistive technologies an accessible name. Control the menu position with positioning.placement.

import type {ReactElement} from "react"

import {
  Copy,
  Ellipsis,
  File,
  FileText,
  FolderOpen,
  Pencil,
  Trash2,
} from "lucide-react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuButtonDemo(): ReactElement {
  return (
    <div className="flex gap-2.5">
      <Menu.Root positioning={{placement: "bottom-end"}}>
        <Menu.Trigger>
          <Menu.Button emphasis="primary" startIcon={File}>
            File
          </Menu.Button>
        </Menu.Trigger>
        <Portal>
          <Menu.Positioner>
            <Menu.Content>
              <Menu.Item value="new-text-file">
                <Menu.ItemStartIcon icon={FileText} />
                New Text File
              </Menu.Item>
              <Menu.Item value="new-file">
                <Menu.ItemStartIcon icon={File} />
                New File...
              </Menu.Item>
              <Menu.Item value="open-file">
                <Menu.ItemStartIcon icon={FolderOpen} />
                Open File...
              </Menu.Item>
            </Menu.Content>
          </Menu.Positioner>
        </Portal>
      </Menu.Root>

      <Menu.Root size="sm">
        <Menu.Trigger>
          <Menu.IconButton
            aria-label="More actions"
            emphasis="primary"
            icon={Ellipsis}
          />
        </Menu.Trigger>
        <Portal>
          <Menu.Positioner>
            <Menu.Content>
              <Menu.Item value="rename">
                <Menu.ItemStartIcon icon={Pencil} />
                Rename
              </Menu.Item>
              <Menu.Item value="duplicate">
                <Menu.ItemStartIcon icon={Copy} />
                Duplicate
              </Menu.Item>
              <Menu.Item value="delete">
                <Menu.ItemStartIcon icon={Trash2} />
                Delete
              </Menu.Item>
            </Menu.Content>
          </Menu.Positioner>
        </Portal>
      </Menu.Root>
    </div>
  )
}

Place <Menu.Header> before the menu content and <Menu.Footer> after it. Both stay in place while the items scroll.

<Menu.Positioner>
  <Menu.Header>
    <Menu.HeaderLabel>Filters</Menu.HeaderLabel>
  </Menu.Header>
  <Menu.Content style={{maxHeight: 200}}>
    {/* items */}
  </Menu.Content>
  <Menu.Footer>
    <Button>Apply</Button>
  </Menu.Footer>
</Menu.Positioner>

Use Button for header and footer actions. Header buttons default to the menu size, compact density, and the ghost variant. Footer buttons default to compact density and a size of md for a small menu or lg for a medium menu. Footer buttons fill the available width. Set button props to override these defaults.

Arrow keys move between menu items. Tab and Shift + Tab move focus between the header, the items, and the footer, and wrap at the ends.

Header and footer are only supported on the top-level menu. Don't use them in submenus.

<Menu.Header>
  <Menu.HeaderLabel>
    Applied filters: {selectedFilters.length}
  </Menu.HeaderLabel>
  <Button
    emphasis="primary"
    onClick={() => setSelectedFilters([])}
    type="button"
  >
    Clear all
  </Button>
</Menu.Header>
<Menu.Content style={{maxHeight: 200}}>
  {filters.map(({label, value}) => (
    <Menu.CheckboxItem
      key={value}
      checked={selectedFilters.includes(value)}
      onCheckedChange={(checked) => onCheckedChange(value, checked)}
      value={value}
    >
      <Menu.CheckboxItemControl />
      <Menu.ItemLabel>{label}</Menu.ItemLabel>
    </Menu.CheckboxItem>
  ))}
</Menu.Content>
<Menu.Footer>
  <Button
    emphasis="neutral"
    onClick={() => setOpen(false)}
    type="button"
    variant="fill"
  >
    Apply Filters
  </Button>
</Menu.Footer>

Split Button

Use <Menu.SplitButton> for a split button trigger. The icon-only trigger provides a default "More options" aria-label; use triggerProps to override it. Optionally add an aria-label on the group when both halves share an accessible name. Control the menu position with positioning.placement on the parent <Menu.Root>.

import type {ReactElement} from "react"

import {Download, FileArchive, FileJson, FileText} from "lucide-react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuSplitButtonDemo(): ReactElement {
  return (
    <Menu.Root positioning={{placement: "bottom-end"}}>
      <Menu.SplitButton
        aria-label="Download"
        emphasis="primary"
        onClick={() => console.log("Download")}
        startIcon={Download}
        triggerProps={{"aria-label": "More download options"}}
      >
        Download
      </Menu.SplitButton>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="pdf">
              <Menu.ItemStartIcon icon={FileText} />
              Download as PDF
            </Menu.Item>
            <Menu.Item value="json">
              <Menu.ItemStartIcon icon={FileJson} />
              Download as JSON
            </Menu.Item>
            <Menu.Item value="zip">
              <Menu.ItemStartIcon icon={FileArchive} />
              Download as ZIP
            </Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Context Menu

Demonstrates how to trigger a menu on right-click or other context events.

import type {ReactElement} from "react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuContextMenuDemo(): ReactElement {
  return (
    <Menu.Root>
      <Menu.ContextTrigger className="flex h-48 w-full items-center justify-center border border-dashed">
        Right click here
      </Menu.ContextTrigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.ItemGroup>
              <Menu.Item value="new-txt">New Text File</Menu.Item>
              <Menu.Item value="new-file">New File...</Menu.Item>
              <Menu.Item value="open-file">Open File...</Menu.Item>
              <Menu.Item value="export">Export</Menu.Item>
            </Menu.ItemGroup>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Nested Menus

Compose nested menus by nesting <Menu.Root> components inside each other.

<Menu.Root>
  <Menu.Trigger>
    <Menu.Button emphasis="primary">Show Menu</Menu.Button>
  </Menu.Trigger>
  <Portal>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.Item value="new-txt">New Text File</Menu.Item>
        <Menu.Item value="new-file">New File...</Menu.Item>
        <Menu.Root positioning={{gutter: 2, placement: "right-start"}}>
          <Menu.TriggerItem value="open-recent">
            Open Recent
          </Menu.TriggerItem>
          <Portal>
            <Menu.Positioner>
              <Menu.Content>
                <Menu.Item value="file-1">File 1</Menu.Item>
                <Menu.Item value="file-2">File 2</Menu.Item>
                <Menu.Item value="file-3">File 3</Menu.Item>
              </Menu.Content>
            </Menu.Positioner>
          </Portal>
        </Menu.Root>
      </Menu.Content>
    </Menu.Positioner>
  </Portal>
</Menu.Root>

Menu items can be links using polymorphic composition. Use the render prop on the <Menu.Item> to specify the element type.

<Menu.Content>
  <Menu.Item
    render={
      <a href="https://react.dev" rel="noreferrer" target="_blank" />
    }
    value="react"
  >
    <Menu.ItemStartIcon icon={ExternalLink} />
    React
  </Menu.Item>
  <Menu.Item
    render={
      <a
        href="https://angular.dev"
        rel="noreferrer"
        target="_blank"
      />
    }
    value="angular"
  >
    <Menu.ItemStartIcon icon={ExternalLink} />
    Angular
  </Menu.Item>
</Menu.Content>

Groups

Use the <Menu.ItemGroup> component to group menu items.

Item Types

There are three item types, each corresponding to one of the three types of aria menu item roles:

  • <Menu.Item> — menuitem
  • <Menu.RadioItem> — menuitemradio
  • <Menu.CheckboxItem> — menuitemcheckbox

Checkbox Items

There are two appearance options:

<Menu.ItemGroup>
  <Menu.ItemGroupLabel>Choose an option</Menu.ItemGroupLabel>
  <Menu.CheckboxItem value="item-1-1">
    <Menu.CheckboxItemControl />
    <Menu.ItemLabel>Option 1</Menu.ItemLabel>
  </Menu.CheckboxItem>
  <Menu.CheckboxItem value="item-1-2">
    <Menu.CheckboxItemControl />
    <Menu.ItemLabel>Option 2</Menu.ItemLabel>
  </Menu.CheckboxItem>
</Menu.ItemGroup>

<Menu.ItemGroup>
  <Menu.ItemGroupLabel>Choose an option</Menu.ItemGroupLabel>
  <Menu.CheckboxItem value="item-2-1">
    <Menu.ItemLabel>Option 1</Menu.ItemLabel>
    <Menu.ItemIndicator />
  </Menu.CheckboxItem>
  <Menu.CheckboxItem value="item-2-2">
    <Menu.ItemLabel>Option 2</Menu.ItemLabel>
    <Menu.ItemIndicator />
  </Menu.CheckboxItem>
</Menu.ItemGroup>

Checkbox Selection State

Illustrates how to manage and reflect the checked state of checkbox menu items.

<Menu.ItemGroup>
  <Menu.ItemGroupLabel>Choose an option</Menu.ItemGroupLabel>
  {items.map(({label, value}) => (
    <Menu.CheckboxItem
      key={value}
      checked={checkboxState[value] || false}
      onCheckedChange={(checked) => onChange(value, checked)}
      value={value}
    >
      <Menu.ItemLabel>{label}</Menu.ItemLabel>
      <Menu.ItemIndicator />
    </Menu.CheckboxItem>
  ))}
</Menu.ItemGroup>

Radio Group

Demonstrates how to group radio menu items so only one can be selected at a time.

import type {ReactElement} from "react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuRadioGroupDemo(): ReactElement {
  return (
    <Menu.Root>
      <Menu.Trigger>
        <Menu.Button emphasis="primary">Show Menu</Menu.Button>
      </Menu.Trigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.RadioItemGroup>
              <Menu.ItemGroupLabel>Choose an option</Menu.ItemGroupLabel>
              <Menu.RadioItem value="one">
                <Menu.RadioItemControl />
                <Menu.ItemLabel>Option 1</Menu.ItemLabel>
              </Menu.RadioItem>
              <Menu.RadioItem value="two">
                <Menu.RadioItemControl />
                <Menu.ItemLabel>Option 2</Menu.ItemLabel>
              </Menu.RadioItem>
              <Menu.RadioItem value="three">
                <Menu.RadioItemControl />
                <Menu.ItemLabel>Option 3</Menu.ItemLabel>
              </Menu.RadioItem>
            </Menu.RadioItemGroup>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Controlled State

The menu's visibility can be controlled via the open, onOpenChange, and defaultOpen props.

  • Use open to explicitly set whether the menu is open (controlled mode).
  • Use onOpenChange to be notified when the menu requests to open or close.
  • Use defaultOpen to set the initial open state when you don't need to control it yourself (uncontrolled mode).

In controlled mode, the open prop should be updated in response to onOpenChange events to reflect the desired visibility.

import {type ReactElement, useState} from "react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuControlledStateDemo(): ReactElement {
  const [open, setOpen] = useState<boolean>(false)

  return (
    <Menu.Root onOpenChange={(nextState) => setOpen(nextState)} open={open}>
      <Menu.Trigger>
        <Menu.Button emphasis="primary">Show Menu</Menu.Button>
      </Menu.Trigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="new-txt">New Text File</Menu.Item>
            <Menu.Item value="new-file">New File...</Menu.Item>
            <Menu.Item value="new-win">New Window</Menu.Item>
            <Menu.Item value="open-file">Open File...</Menu.Item>
            <Menu.Item value="export">Export</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Placement

Configure the menu's placement using the positioning.placement prop.

import type {ReactElement} from "react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuPlacementDemo(): ReactElement {
  return (
    <Menu.Root positioning={{placement: "right-start"}}>
      <Menu.Trigger>
        <Menu.Button emphasis="primary">Show Menu</Menu.Button>
      </Menu.Trigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="new-txt">New Text File</Menu.Item>
            <Menu.Item value="new-file">New File...</Menu.Item>
            <Menu.Item value="new-win">New Window</Menu.Item>
            <Menu.Item value="open-file">Open File...</Menu.Item>
            <Menu.Item value="export">Export</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Sizes

Use the size prop on <Menu.Root> to control the size of the menu. The default size is md. The demo features the small (sm) size.

The <Menu.Button> and <Menu.IconButton> triggers inherit the menu's size, so the trigger and menu match by default. Such a trigger can run larger than its menu: set size on it to override the inherited value. An md menu pairs with an md or lg trigger. A compact trigger should always pair with an sm menu. When a trigger uses density="compact", set size="sm" on <Menu.Root>.

Other trigger content does not inherit the menu size. A link, an avatar, or a custom element placed in the trigger must be sized directly.

import type {ReactElement} from "react"

import {LogOut, Settings, User} from "lucide-react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuSizesDemo(): ReactElement {
  return (
    <Menu.Root size="sm">
      <Menu.Trigger>
        <Menu.Button emphasis="primary">Show Menu</Menu.Button>
      </Menu.Trigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="account">
              <Menu.ItemStartIcon icon={User} />
              Account
            </Menu.Item>
            <Menu.Item value="settings">
              <Menu.ItemStartIcon icon={Settings} />
              Settings
            </Menu.Item>
            <Menu.Item value="logout">
              <Menu.ItemStartIcon icon={LogOut} />
              Logout
            </Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Anchor Point

Use the positioning.anchorPoint prop to control the anchor point of the menu.

Anchor
import {type ReactElement, useRef} from "react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuAnchorPointDemo(): ReactElement {
  const ref = useRef<HTMLDivElement | null>(null)
  const getAnchorRect = () => ref.current!.getBoundingClientRect()

  return (
    <Menu.Root positioning={{getAnchorRect}}>
      <div className="flex flex-col gap-4">
        <Menu.Trigger>
          <Menu.Button emphasis="primary">Show Menu</Menu.Button>
        </Menu.Trigger>
        <div
          ref={ref}
          className="font-body-lg text-neutral-primary bg-neutral-04 border-neutral-01 rounded-md border p-4"
        >
          Anchor
        </div>
      </div>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="new-txt">New Text File</Menu.Item>
            <Menu.Item value="new-file">New File...</Menu.Item>
            <Menu.Item value="new-win">New Window</Menu.Item>
            <Menu.Item value="open-file">Open File...</Menu.Item>
            <Menu.Item value="export">Export</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Avatar

Here's an example that composes the Menu with the Avatar component to display a user account menu.

import type {ReactElement} from "react"

import {LogOut, Settings, User} from "lucide-react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Avatar} from "@qualcomm-ui/react/avatar"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuAvatarDemo(): ReactElement {
  return (
    <Menu.Root positioning={{placement: "right-start"}}>
      <Menu.Trigger>
        <Avatar.Root render={<button />} status="active">
          <Avatar.Image alt="John Doe" src="/images/avatar-man.png" />
          <Avatar.Content>JD</Avatar.Content>
          <Avatar.Status />
        </Avatar.Root>
      </Menu.Trigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="account">
              <Menu.ItemStartIcon icon={User} />
              Account
            </Menu.Item>
            <Menu.Item value="settings">
              <Menu.ItemStartIcon icon={Settings} />
              Settings
            </Menu.Item>
            <Menu.Item value="logout">
              <Menu.ItemStartIcon icon={LogOut} />
              Logout
            </Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Within Dialog

When using the Menu inside a Dialog, don't render the <Menu.Positioner> within a <Portal> element.

import type {ReactElement} from "react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Button} from "@qualcomm-ui/react/button"
import {Dialog} from "@qualcomm-ui/react/dialog"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuWithinDialogDemo(): ReactElement {
  return (
    <Dialog.Root>
      <Dialog.Trigger>
        <Button emphasis="primary" variant="fill">
          Show Dialog
        </Button>
      </Dialog.Trigger>

      <Portal>
        <Dialog.Backdrop />
        <Dialog.Positioner>
          <Dialog.Content className="w-72">
            <Dialog.Body>
              <Dialog.Heading>Dialog Title</Dialog.Heading>
              <Dialog.CloseButton />

              <Menu.Root>
                <Menu.Trigger>
                  <Menu.Button className="place-self-start" emphasis="primary">
                    Show Menu
                  </Menu.Button>
                </Menu.Trigger>
                <Menu.Positioner>
                  <Menu.Content>
                    <Menu.Item value="new-txt">New Text File</Menu.Item>
                    <Menu.Item value="new-file">New File...</Menu.Item>
                    <Menu.Item value="new-win">New Window</Menu.Item>
                    <Menu.Item value="open-file">Open File...</Menu.Item>
                    <Menu.Item value="export">Export</Menu.Item>
                  </Menu.Content>
                </Menu.Positioner>
              </Menu.Root>
            </Dialog.Body>
          </Dialog.Content>
        </Dialog.Positioner>
      </Portal>
    </Dialog.Root>
  )
}

Hide When Detached

Use the positioning.hideWhenDetached prop to hide the menu when it's detached from the trigger.

Item 0
Item 1
Item 2
Item 3
Item 4
Item 5
import type {ReactElement} from "react"

import {Portal} from "@qualcomm-ui/react-core/portal"
import {Menu} from "@qualcomm-ui/react/menu"

export function MenuHideWhenDetachedDemo(): ReactElement {
  return (
    <Menu.Root open positioning={{hideWhenDetached: true}}>
      <div className="border-neutral-03 box-border flex max-w-72 gap-2 overflow-x-scroll rounded-md border p-4">
        {[...Array(6).keys()].map((x) => (
          <div
            key={x}
            className="font-body-md text-neutral-primary border-neutral-01 bg-neutral-04 rounded-md border p-3 whitespace-nowrap"
          >
            Item {x}
          </div>
        ))}
        <Menu.Trigger>
          <Menu.Button className="whitespace-nowrap" emphasis="primary">
            Show Menu
          </Menu.Button>
        </Menu.Trigger>
      </div>

      <Portal>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="new-txt">New Text File</Menu.Item>
            <Menu.Item value="new-file">New File...</Menu.Item>
            <Menu.Item value="new-win">New Window</Menu.Item>
            <Menu.Item value="open-file">Open File...</Menu.Item>
            <Menu.Item value="export">Export</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  )
}

Explorer

Actions

API

PropTypeDefault
React children prop.
The positioning point for the menu. Can be set by the context menu trigger or the button trigger.
{
x: number
y: number
} | null
Whether to close the menu when an option is selected
boolean
true
Whether the menu is composed with other composite widgets like a combobox or tabs
boolean
true
The initial highlighted value of the menu item when rendered. Use when you don't need to control the highlighted value of the menu item.
string | null
The initial open state of the menu when rendered. Use when you don't need to control the open state of the menu.
boolean
The document's text/writing direction.
'ltr' | 'rtl'
'ltr'
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
() =>
| ShadowRoot
| Document
| Node
The controlled highlighted value of the menu item.
string | null
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
string
Whether to synchronize the present change immediately or defer it to the next frame
boolean
When true, the component will not be rendered in the DOM until it becomes visible or active.
boolean
false
Whether to loop the keyboard navigation.
boolean
false
Function to navigate to the selected item if it's an anchor element
| ((details: {
href: string
node: HTMLAnchorElement
value: string
}) => void)
| null
Function called when the escape key is pressed
(
event: KeyboardEvent,
) => void
Function called when the animation ends in the closed state
VoidFunction
Function called when the focus is moved outside the component
| ((
event: FocusOutsideEvent,
) => void)
| undefined
Function called when the highlighted menu item changes.
(
value: string | null,
) => void
Function called when an interaction happens outside the component
| ((
event: InteractOutsideEvent,
) => void)
| undefined
Function called when the menu opens or closes
(
open: boolean,
) => void
Function called when the pointer is pressed down outside the component
| ((
event: PointerDownOutsideEvent,
) => void)
| undefined
Function called when this layer is closed due to a parent layer being closed
(
event: LayerDismissEvent,
) => void
Function called when a menu item is selected.
(
value: string,
) => void
The controlled open state of the menu
boolean
The options used to dynamically position the menu
| MenuPositioningOptions
| undefined
Whether the node is present (controlled by the user)
boolean
'sm' | 'md'
Whether to allow the initial presence animation.
boolean
false
Whether the pressing printable characters should trigger typeahead navigation
boolean
true
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.
boolean
false
Description
React children prop.
Type
{
x: number
y: number
} | null
Description
The positioning point for the menu. Can be set by the context menu trigger or the button trigger.
Type
boolean
Description
Whether to close the menu when an option is selected
Type
boolean
Description
Whether the menu is composed with other composite widgets like a combobox or tabs
Type
string | null
Description
The initial highlighted value of the menu item when rendered. Use when you don't need to control the highlighted value of the menu item.
Type
boolean
Description
The initial open state of the menu when rendered. Use when you don't need to control the open state of the menu.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
() =>
| ShadowRoot
| Document
| Node
Description
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
Type
string | null
Description
The controlled highlighted value of the menu item.
Type
string
Description
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
Type
boolean
Description
Whether to synchronize the present change immediately or defer it to the next frame
Type
boolean
Description
When true, the component will not be rendered in the DOM until it becomes visible or active.
Type
boolean
Description
Whether to loop the keyboard navigation.
Type
| ((details: {
href: string
node: HTMLAnchorElement
value: string
}) => void)
| null
Description
Function to navigate to the selected item if it's an anchor element
Type
(
event: KeyboardEvent,
) => void
Description
Function called when the escape key is pressed
Type
VoidFunction
Description
Function called when the animation ends in the closed state
Type
| ((
event: FocusOutsideEvent,
) => void)
| undefined
Description
Function called when the focus is moved outside the component
Type
(
value: string | null,
) => void
Description
Function called when the highlighted menu item changes.
Type
| ((
event: InteractOutsideEvent,
) => void)
| undefined
Description
Function called when an interaction happens outside the component
Type
(
open: boolean,
) => void
Description
Function called when the menu opens or closes
Type
| ((
event: PointerDownOutsideEvent,
) => void)
| undefined
Description
Function called when the pointer is pressed down outside the component
Type
(
event: LayerDismissEvent,
) => void
Description
Function called when this layer is closed due to a parent layer being closed
Type
(
value: string,
) => void
Description
Function called when a menu item is selected.
Type
boolean
Description
The controlled open state of the menu
Type
| MenuPositioningOptions
| undefined
Description
The options used to dynamically position the menu
Type
boolean
Description
Whether the node is present (controlled by the user)
Type
'sm' | 'md'
Type
boolean
Description
Whether to allow the initial presence animation.
Type
boolean
Description
Whether the pressing printable characters should trigger typeahead navigation
Type
boolean
Description
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.

The positioning prop accepts an object with the following shape:

PropTypeDefault
The minimum padding between the arrow and the floating element's corner.
number
4
CSS selector used to locate the arrow element within the floating element. Components override this with their own anatomy-namespaced selector (e.g. [data-menu-part=arrow]).
string
The overflow boundary of the reference element
() =>
| 'clippingAncestors'
| Element
| Array<Element>
| {
height: number
width: number
x: number
y: number
}
CSS selector for the content element whose z-index is copied to the floating element. Falls back to the first child.
string
Whether the popover should fit the viewport.
boolean
Whether to flip the placement when the floating element overflows the boundary.
| boolean
| Array<
| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
>
true
Function that returns the anchor rect
(
element:
| HTMLElement
| VirtualElement
| null,
) => AnchorRect | null
The main axis offset or gap between the reference and floating element
number
2
Whether the popover should be hidden when the reference element is detached
boolean
Options to activate auto-update listeners
| boolean
| AutoUpdateOptions
true
The offset of the floating element
{
crossAxis?: number
mainAxis?: number
}
Function called when the placement is computed
(
data: ComputePositionReturn,
) => void
Function called when the floating element is positioned or not
(data: {
placed: boolean
}) => void
The virtual padding around the viewport edges to check for overflow
number
Whether the floating element can overlap the reference element
boolean
false
The initial placement of the floating element
| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
'bottom-start'
Whether to make the floating element same width as the reference element
boolean
The secondary axis offset or gap between the reference and floating elements
number
Whether the popover should slide when it overflows.
boolean
The strategy to use for positioning
| 'absolute'
| 'fixed'
'absolute'
A callback that will be called when the popover needs to calculate its position.
(data: {
updatePosition: () => Promise<void>
}) => void | Promise<void>
Type
number
Description
The minimum padding between the arrow and the floating element's corner.
Type
string
Description
CSS selector used to locate the arrow element within the floating element. Components override this with their own anatomy-namespaced selector (e.g. [data-menu-part=arrow]).
Type
() =>
| 'clippingAncestors'
| Element
| Array<Element>
| {
height: number
width: number
x: number
y: number
}
Description
The overflow boundary of the reference element
Type
string
Description
CSS selector for the content element whose z-index is copied to the floating element. Falls back to the first child.
Type
boolean
Description
Whether the popover should fit the viewport.
Type
| boolean
| Array<
| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
>
Description
Whether to flip the placement when the floating element overflows the boundary.
Type
(
element:
| HTMLElement
| VirtualElement
| null,
) => AnchorRect | null
Description
Function that returns the anchor rect
Type
number
Description
The main axis offset or gap between the reference and floating element
Type
boolean
Description
Whether the popover should be hidden when the reference element is detached
Type
| boolean
| AutoUpdateOptions
Description
Options to activate auto-update listeners
Type
{
crossAxis?: number
mainAxis?: number
}
Description
The offset of the floating element
Type
(
data: ComputePositionReturn,
) => void
Description
Function called when the placement is computed
Type
(data: {
placed: boolean
}) => void
Description
Function called when the floating element is positioned or not
Type
number
Description
The virtual padding around the viewport edges to check for overflow
Type
boolean
Description
Whether the floating element can overlap the reference element
Type
| 'bottom'
| 'bottom-end'
| 'bottom-start'
| 'left'
| 'left-end'
| 'left-start'
| 'right'
| 'right-end'
| 'right-start'
| 'top'
| 'top-end'
| 'top-start'
Description
The initial placement of the floating element
Type
boolean
Description
Whether to make the floating element same width as the reference element
Type
number
Description
The secondary axis offset or gap between the reference and floating elements
Type
boolean
Description
Whether the popover should slide when it overflows.
Type
| 'absolute'
| 'fixed'
Description
The strategy to use for positioning
Type
(data: {
updatePosition: () => Promise<void>
}) => void | Promise<void>
Description
A callback that will be called when the popover needs to calculate its position.

Element API

The following describes the individual subcomponents of the Menu component.

PropTypeDefault
v1.32.0
A NumberBadge or StatusBadge, positioned after the text content. Its emphasis, size, and disabled state default to values that match the button. Props set on the badge take precedence.
React children prop.
The density of the button. Governs padding and height.
| 'default'
| 'compact'
'default'
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
boolean
false
The style variant of the button. Governs colors.
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
'neutral'
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The size of the component and its icons.
| 'sm'
| 'md'
| 'lg'
'md'
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
| LucideIcon
| ReactElement
| null
The style variant of the button. Governs colors.
| 'fill'
| 'ghost'
| 'outline'
'fill'
v1.32.0
Description
A NumberBadge or StatusBadge, positioned after the text content. Its emphasis, size, and disabled state default to values that match the button. Props set on the badge take precedence.
Description
React children prop.
Type
| 'default'
| 'compact'
Description
The density of the button. Governs padding and height.
Type
boolean
Description
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
Type
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
Description
The style variant of the button. Governs colors.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the component and its icons.
Type
| LucideIcon
| ReactElement
| null
Description
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
Type
| 'fill'
| 'ghost'
| 'outline'
Description
The style variant of the button. Governs colors.
PropTypeDefault
The density of the button. Governs padding and height.
| 'default'
| 'compact'
'default'
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
boolean
false
The style variant of the button. Governs colors.
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
'neutral'
Optional lucide-react icon displayed alongside the chevron indicator. When omitted, only the chevron is rendered.
LucideIcon
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Governs the shape of the icon button.
| 'square'
| 'rounded'
'square'
The size of the component and its icons.
| 'sm'
| 'md'
| 'lg'
'md'
The style variant of the button. Governs colors.
| 'fill'
| 'ghost'
| 'outline'
'fill'
Type
| 'default'
| 'compact'
Description
The density of the button. Governs padding and height.
Type
boolean
Description
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
Type
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
Description
The style variant of the button. Governs colors.
Type
LucideIcon
Description
Optional lucide-react icon displayed alongside the chevron indicator. When omitted, only the chevron is rendered.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'square'
| 'rounded'
Description
Governs the shape of the icon button.
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the component and its icons.
Type
| 'fill'
| 'ghost'
| 'outline'
Description
The style variant of the button. Governs colors.
PropTypeDefault
Props applied to the primary action button.
Omit<
ButtonProps,
| 'disabled'
| 'density'
| 'emphasis'
| 'size'
| 'variant'
| 'children'
>
Content rendered inside the primary action button.
The density of the buttons. Governs padding and height.
| 'default'
| 'compact'
'default'
Disables every button in the group.
boolean
false
The emphasis of the buttons in the group.
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
Icon positioned after the primary action label.
| LucideIcon
| ReactElement
| null
| undefined
Called when the primary action button is clicked.
| MouseEventHandler<HTMLButtonElement>
| undefined
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The size of the buttons in the group.
| 'sm'
| 'md'
| 'lg'
'md'
Icon positioned before the primary action label.
| LucideIcon
| ReactElement
| null
| undefined
Props applied to the chevron trigger button.
Omit<
MenuIconButtonProps,
| 'disabled'
| 'density'
| 'emphasis'
| 'size'
| 'variant'
>
The variant of the buttons in the group.
| 'fill'
| 'ghost'
| 'outline'
Type
Omit<
ButtonProps,
| 'disabled'
| 'density'
| 'emphasis'
| 'size'
| 'variant'
| 'children'
>
Description
Props applied to the primary action button.
Description
Content rendered inside the primary action button.
Type
| 'default'
| 'compact'
Description
The density of the buttons. Governs padding and height.
Type
boolean
Description
Disables every button in the group.
Type
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
Description
The emphasis of the buttons in the group.
Type
| LucideIcon
| ReactElement
| null
| undefined
Description
Icon positioned after the primary action label.
Type
| MouseEventHandler<HTMLButtonElement>
| undefined
Description
Called when the primary action button is clicked.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the buttons in the group.
Type
| LucideIcon
| ReactElement
| null
| undefined
Description
Icon positioned before the primary action label.
Type
Omit<
MenuIconButtonProps,
| 'disabled'
| 'density'
| 'emphasis'
| 'size'
| 'variant'
>
Description
Props applied to the chevron trigger button.
Type
| 'fill'
| 'ghost'
| 'outline'
Description
The variant of the buttons in the group.
A container that positions the menu relative to its anchor element. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
The top section of the menu. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
The menu header text. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
The bottom section of the menu. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Enhances a child element to open the menu when clicked. Requires a single child element.
PropType
React children Render Prop
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
string
Type
string
Description
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
PropType
The unique value of the menu item option.
string
React children prop.
Whether the menu should be closed when the option is selected.
boolean
Whether the menu item is disabled
boolean
The function to call when the item is selected
() => void
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
string
Type
string
Description
The unique value of the menu item option.
Description
React children prop.
Type
boolean
Description
Whether the menu should be closed when the option is selected.
Type
boolean
Description
Whether the menu item is disabled
Type
() => void
Description
The function to call when the item is selected
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
string
Description
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
id for this item group.
string
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
string
Description
id for this item group.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
lucide-react icon or JSX Element.
| LucideIcon
| ReactElement
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Type
| LucideIcon
| ReactElement
Description
lucide-react icon or JSX Element.
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
The value of the option
string
Whether the option is checked
boolean
React children prop.
Whether the menu should be closed when the option is selected.
boolean
Whether the menu item is disabled
boolean
Function called when the option state is changed
(
checked: boolean,
) => void
The function to call when the item is selected
() => void
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
string
Type
string
Description
The value of the option
Type
boolean
Description
Whether the option is checked
Description
React children prop.
Type
boolean
Description
Whether the menu should be closed when the option is selected.
Type
boolean
Description
Whether the menu item is disabled
Type
(
checked: boolean,
) => void
Description
Function called when the option state is changed
Type
() => void
Description
The function to call when the item is selected
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
string
Description
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
PropTypeDefault
React children prop.
<Checkbox.IndicatorIcon />
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
The unique value of the menu item option.
string
React children prop.
Whether the menu should be closed when the option is selected.
boolean
Whether the menu item is disabled
boolean
The function to call when the item is selected
() => void
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
string
Type
string
Description
The unique value of the menu item option.
Description
React children prop.
Type
boolean
Description
Whether the menu should be closed when the option is selected.
Type
boolean
Description
Whether the menu item is disabled
Type
() => void
Description
The function to call when the item is selected
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
string
Description
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
PropType
React children prop.
string
(
value: string,
) => void
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
string
Description
React children prop.
Type
string
Type
(
value: string,
) => void
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
string
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
A menu item that triggers a submenu on hover or click. Renders a <button> element by default.
PropTypeDefault
The unique value of the menu item option.
string
React children prop.
Whether the menu should be closed when the option is selected.
boolean
Whether the menu item is disabled
boolean
Icon to display next to the label, which indicates that this menu item is a trigger for a submenu.
| LucideIcon
| ReactElement
ChevronRight
Deprecated never called. Use onOpenChange on the submenu's <Menu.Root> instead.
() => void
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
string
Type
string
Description
The unique value of the menu item option.
Description
React children prop.
Type
boolean
Description
Whether the menu should be closed when the option is selected.
Type
boolean
Description
Whether the menu item is disabled
Type
| LucideIcon
| ReactElement
Description
Icon to display next to the label, which indicates that this menu item is a trigger for a submenu.
Type
() => void
Description
Deprecated never called. Use onOpenChange on the submenu's <Menu.Root> instead.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
string
Description
The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.
Updated by Olaf Kappes