Skip to content

ActionMenu

A compact ⋮ (three-dot) vertical menu that shows a dropdown list of actions on click. Closes automatically on outside click.

Basic Usage

Demo

Props

Props
PropTypeDefaultDescription
itemsrequiredActionMenuItem[]Array of menu items to render in the dropdown.

ActionMenuItem Interface

ts
interface ActionMenuItem {
  label: string               // Display text for the menu item
  lucideIcon?: Component      // Lucide Vue icon component (imported directly)
  class?: string              // CSS class for the icon (e.g. 'text-red-500')
  command?: () => void        // Function to call when the item is clicked
}

Accessibility

  • The trigger button has aria-label="Open actions menu" and aria-haspopup="true".
  • Closes on outside click via a global click event listener.
  • Each menu item is clickable via keyboard (inherits from native click handling).

Built with VitePress