@antadesign/anta
    Preparing search index...

    Function MenuUnreviewed

    • Menu — a dropdown / context menu that anchors to any target and "just works". Place <Menu> immediately after the trigger element (a button, say); it opens on click by default. For a whole-area right-click menu, put it after the region and pass context.

      Open state is uncontrolled by default — listen for onStateChange (detail: { next, prev }) to observe it, or pass open to control it. You can also keep a ref and call .open() / .close() / .toggle(). Selecting a MenuItem closes the menu; arbitrary injected content does not. Add data-menu-open to any item / container to keep it open, or data-menu-close to a custom element to let it close.

      Requires @antadesign/anta/elements to be imported (client-side only).

      Parameters

      Returns any

      <a-button>Actions</a-button>
      <Menu>
      <MenuItem icon="edit" label="Edit" kbd="⌘E" onSelect={onEdit} />
      <MenuSeparator />
      <MenuItem tone="critical" icon="trash" label="Delete" onSelect={onDelete} />
      </Menu>