Skip to content

DropdownMenu

<ax-dropdown-menu> is an anchored menu opened from a trigger that wears [axMenuTriggerFor]. Project menu-item family components into the menu. The same surface can be opened as a context menu with [axContextMenuTriggerFor] — see ContextMenu.

import {
AxDropdownMenuComponent,
AxMenuTriggerDirective,
AxMenuItemComponent,
AxMenuCheckboxItemComponent,
AxMenuRadioGroupComponent,
AxMenuRadioItemComponent,
AxMenuLabelComponent,
AxMenuSeparatorComponent,
} from '@axisui-ng/overlays';
<ax-button [axMenuTriggerFor]="menu">Options</ax-button>
<ax-dropdown-menu #menu>
<ax-menu-label>Account</ax-menu-label>
<ax-menu-item (select)="profile()">Profile</ax-menu-item>
<ax-menu-item [disabled]="true">Billing</ax-menu-item>
<ax-menu-separator />
<ax-menu-checkbox-item [(checked)]="compact">Compact mode</ax-menu-checkbox-item>
<ax-menu-radio-group [(value)]="theme">
<ax-menu-radio-item value="light">Light</ax-menu-radio-item>
<ax-menu-radio-item value="dark">Dark</ax-menu-radio-item>
</ax-menu-radio-group>
</ax-dropdown-menu>

Pass a TemplateRef to [submenu] on ax-menu-item. The template should contain another <ax-dropdown-menu> of items:

<ax-dropdown-menu #menu>
<ax-menu-item [submenu]="shareTpl">Share</ax-menu-item>
</ax-dropdown-menu>
<ng-template #shareTpl>
<ax-dropdown-menu>
<ax-menu-item>Email link</ax-menu-item>
<ax-menu-item>Copy link</ax-menu-item>
</ax-dropdown-menu>
</ng-template>
Input / outputTypeDefaultNotes
openmodel<boolean>falseOpen state (driven by the trigger).
closedoutput<void>Emitted when close() runs (e.g. after selecting a leaf item).
InputTypeDefaultNotes
axMenuTriggerForAxDropdownMenuComponent (required)Menu instance to open.
placementPlacementInput'bottom-start'Placement relative to the trigger.

Sets aria-haspopup="menu" and aria-expanded. Outside-click closes; focus returns to the trigger.

Input / outputTypeDefaultNotes
disabledbooleanfalseNon-interactive; skipped by keyboard nav.
submenuTemplateRef<MenuSubitemConfig> | undefinedundefinedNested menu template; click/ArrowRight opens instead of selecting.
selectoutput<void>Emitted on activate (click or Enter/Space) for leaf items.
InputTypeDefaultNotes
checkedmodel<boolean>falseTwo-way checked state (role="menuitemcheckbox").
disabledbooleanfalseSkipped by keyboard navigation.
InputTypeDefaultNotes
valuemodel<string | null>nullSelected radio value (two-way).
InputTypeDefaultNotes
valuestring (required)This item’s value within the group.
disabledbooleanfalseSkipped by keyboard navigation.
ComponentNotes
ax-menu-labelNon-interactive section heading (role="presentation").
ax-menu-separatorHorizontal divider (role="separator").

role="menu" with menuitem / menuitemcheckbox / menuitemradio children. Arrow keys move via a roving tabindex; type-ahead is supported; Home/End jump ends. Enter/Space activate (or open a submenu). ArrowRight opens a focused item’s submenu; ArrowLeft / Escape close the innermost submenu first, then the root menu. Disabled items are skipped. Focus restores to the trigger on close.

Interactive examples live in Storybook under Overlays / Dropdown Menu (including nested submenus). Run pnpm storybook to explore them.