Skip to content

Dropdown Menu

Overlay

A floating menu that opens on trigger click, displaying a list of actions. The component renders the trigger as its own atlasButton; you project only its content. Menu semantics (roles, keyboard navigation, focus management) from @angular/aria/menu. Positioning and dismissal via CDK Overlay with flip/collision detection.

atlas-dropdown-menu

Examples

Actions menu

Items are data with optional icons, separators and destructive styling; (selected) reports the item.

Last action: —

Row actions, aligned to the end

An icon-only trigger ( triggerSize="icon" ) needs a triggerAriaLabel . align="end" lines the menu up with the trigger's end edge, which keeps it inside a table or a card.

  • report-q3.pdf
  • budget.xlsx

Last: —

Custom item content

Give an item a template to render more than an icon and a label, here a description and a keyboard hint. The template receives the item as let-item ; the item's label stays its accessible name source, so keep it in the template.

Last: —

API

Generated from the library source, so it always matches the code.

AtlasDropdownMenuComponent atlas-dropdown-menu

InputTypeDefaultDescription
items requiredDropdownMenuEntry[]— Menu items and { type: 'separator' } entries, in display order.
align 'start' | 'end''start' Aligns the menu with the start or the end edge of the trigger (follows the text direction).
triggerVariant ButtonVariants['variant']'outline'atlasButton variant of the trigger button the component renders around the projected [trigger] content.
triggerSize ButtonVariants['size']'default'atlasButton size of the trigger button ( icon for an icon-only trigger, then set triggerAriaLabel ).
triggerClass string'' Extra classes for the trigger button, merged through cn() .
triggerAriaLabel string— Accessible name of the trigger ( aria-label ). Required when the trigger shows only an icon; when it has visible text, start the label with that text so speech input can name it.
OutputPayloadDescription
selectedDropdownMenuItem Emits the chosen item (never a disabled one); the menu then closes and focus returns to the trigger.

Functions

FunctionDescription
isSeparator(entry: DropdownMenuEntry): entry is DropdownMenuSeparator Type guard to check if an entry is a separator

Types

Union type for menu entries

type DropdownMenuEntry = DropdownMenuItem | DropdownMenuSeparator

A single item in the dropdown menu

PropertyTypeDescription
id string Unique identifier for the item
label string Display label
icon? string Optional icon name (atlas:xxx)
disabled? boolean Whether the item is disabled
destructive? boolean Whether this is a destructive action (renders in red)
template? TemplateRef<DropdownMenuItemContext> Optional custom template for rendering this item's content. When provided, it replaces the default icon + label rendering. The template receives the item as $implicit (grid-style), e.g. <ng-template #tpl let-item>...{{ item.label }}...</ng-template> .

Template context passed to a menu item's custom template .

PropertyTypeDescription
$implicit DropdownMenuItem The menu item being rendered.

A separator between menu item groups

PropertyTypeDescription
type 'separator' —