ActionMenu

A dropdown menu for presenting contextual actions. Supports flat item lists or grouped items with labels, danger styling for destructive actions, keyboard shortcuts, and controlled open state. Built on Radix UI Dropdown Menu.

Import

import { ActionMenu } from '@wavebooking/aqua-fusion';

Preview

Loading preview...

Usage

<ActionMenu
  items={[
    { key: 'edit', label: 'Edit', onClick: () => handleEdit() },
    { key: 'duplicate', label: 'Duplicate', onClick: () => handleDuplicate() },
    { key: 'delete', label: 'Delete', danger: true, onClick: () => handleDelete() },
  ]}
/>

Grouped items

<ActionMenu
  items={[
    {
      label: 'Actions',
      items: [
        { key: 'edit', label: 'Edit', onClick: () => {} },
        { key: 'duplicate', label: 'Duplicate', onClick: () => {} },
      ],
    },
    {
      label: 'Danger zone',
      items: [
        { key: 'delete', label: 'Delete', danger: true, onClick: () => {} },
      ],
    },
  ]}
/>

Props

PropTypeDefaultDescription
items*ActionMenuItem[] | ActionMenuGroup[]-Menu items as a flat list or grouped with labels.
triggerReactNode-Custom trigger element. Defaults to a vertical ellipsis icon button.
triggerLabelstring'Actions'Accessible label for the default trigger button.
align'start' | 'center' | 'end''end'Horizontal alignment of the dropdown menu.
side'top' | 'right' | 'bottom' | 'left''bottom'Side of the trigger where the menu appears.
triggerClassNamestring-Additional CSS class for the trigger button.
contentClassNamestring-Additional CSS class for the dropdown content.
openboolean-Controlled open state of the menu.
onOpenChange(open: boolean) => void-Callback fired when the open state changes.

ActionMenuItem

PropertyTypeDescription
keystringUnique key for the item.
labelstringDisplay label.
iconReactNodeOptional icon displayed before the label.
onClick() => voidClick handler for the item.
disabledbooleanWhether the item is disabled.
dangerbooleanApplies destructive/danger styling.
shortcutstringKeyboard shortcut hint text.

ActionMenuGroup

PropertyTypeDescription
labelstringOptional group label displayed above items.
itemsActionMenuItem[]Items in this group.