For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /dolan/menu.md.

Menu

A pull-down menu that grows out of the button that opens it, in Liquid Glass on iOS 26 and a Material 3 menu on Android.

Installation

npx @blotch/dolan add menu
import {
  UiMenu,
  UiMenuItem,
  UiMenuSection,
  UiMenuSeparator,
  UiMenuSubmenu,
  UiMenuTrigger,
} from '../components/ui/menu';
Tip

This also adds Glass, which draws the menu, and Icon, for the items' icons.

Usage

import { Component, signal } from '@angular/core';
import { LYNX_ELEMENTS } from '@blotch/angular-lynx';
import { UiGlass } from '../components/ui/glass';
import { UiIcon } from '../components/ui/icon';
import {
  UiMenu,
  UiMenuItem,
  UiMenuSection,
  UiMenuSeparator,
  UiMenuTrigger,
} from '../components/ui/menu';

@Component({
  selector: 'app-trips-toolbar',
  imports: [
    LYNX_ELEMENTS,
    UiGlass,
    UiIcon,
    UiMenu,
    UiMenuItem,
    UiMenuSection,
    UiMenuSeparator,
    UiMenuTrigger,
  ],
  template: `
    <ui-menu>
      <blur-view
        ui-glass
        uiMenuTrigger
        shape="circle"
        class="h-11 w-11 items-center flex justify-center"
        [accessibility-element]="true"
        accessibility-traits="button"
        accessibility-label="More"
      >
        <ui-icon name="ellipsis" />
      </blur-view>

      <ui-menu-section title="Sort by">
        <ui-menu-item
          label="Name"
          [checked]="sort() === 'name'"
          (pressed)="sort.set('name')"
        />
        <ui-menu-item
          label="Date"
          [checked]="sort() === 'date'"
          (pressed)="sort.set('date')"
        />
      </ui-menu-section>
      <ui-menu-separator />
      <ui-menu-item label="New trip" icon="plus" (pressed)="newTrip()" />
    </ui-menu>
  `,
})
export class TripsToolbar {
  protected readonly sort = signal<'name' | 'date'>('date');

  protected newTrip(): void {}
}
  • uiMenuTrigger marks the element that opens the menu. A tap on it opens and closes it. Anything can be the trigger: a glass button, as here, a Button, or your own view.
  • Everything else inside <ui-menu> is the menu: <ui-menu-item>, <ui-menu-section>, <ui-menu-separator> and <ui-menu-submenu>.
  • On iOS, press the trigger and slide onto an item to choose it. The menu opens as the finger touches down, as UIKit's pull-down menus do, and lifting on an item chooses it. Lifting without sliding leaves the menu open for a tap. On Android it opens on the tap, as Material's menus do.
  • Choosing an item emits its pressed, then closes the menu. A tap outside the menu, or Android's back button, closes it without choosing.
  • It stays on screen and inside the safe area. Near the bottom of the screen it opens upward, and in the right half it lines up with the trigger's right edge. Opening upward on iOS, it lists its items from the bottom up, so the first is nearest the finger, as UIKit's menus do (a section keeps its title above its items). Android keeps the order.
  • [(open)] opens and closes it from code, as with Dialog.

What each platform draws

PlatformWhat you get
iOS 26 and laterLiquid Glass that grows out of the trigger and shrinks back into it, with the icon before each label
iOS 15 to 25The same on the frosted material, with the icon after each label and a thick band between sections
AndroidA Material 3 menu that unfolds below the trigger, on a solid surface with a shadow
Android, with provideGlass({ android: 'glass' })Liquid Glass, as on iOS
Web previewLiquid Glass, as on iOS

On iOS the menu is one glass shape whose frame grows from the trigger's to the menu's, and the trigger hides under it meanwhile. Liquid Glass follows a shape as it moves and resizes, so the trigger seems to open into the menu. A trigger that's glass itself (<blur-view ui-glass uiMenuTrigger>) hands its glass over to the menu on iOS 26, in the app ng build --platform ios builds: the menu takes over its corners, and its icon fades out as the menu grows, and back in as it closes (see Glass).

Items

<ui-menu-item label="Share" icon="upload" (pressed)="share()" />
<ui-menu-item
  label="Delete"
  icon="trash"
  variant="destructive"
  (pressed)="remove()"
/>
<ui-menu-item label="Archive" icon="archive" disabled />
  • label is the item's text, and what a screen reader reads.
  • icon takes a name from the icon set. Give icons to common actions, such as share, copy and delete.
  • svg takes your own icon's markup instead, for an action the set has nothing for, such as opening your app's other product: <ui-menu-item label="Open in Acme" [svg]="acmeMark" />. currentColor in it takes the item's color, red on a destructive item, and colors written out stay. xmlns is optional, and lines must be <path>s, as for an icon's own SVG. Give icon or svg, not both.
  • variant="destructive" colors the item red, for actions that delete or can't be undone.
  • disabled shows the item, faded, without letting it be chosen.

Check marks

checked shows a checkmark, for an option that's on:

<ui-menu-item
  label="Name"
  [checked]="sort() === 'name'"
  (pressed)="sort.set('name')"
/>
<ui-menu-item
  label="Date"
  [checked]="sort() === 'date'"
  (pressed)="sort.set('date')"
/>

Set checked, true or false, on every item of the group. An unchecked item keeps the checkmark's space, so the labels line up.

Sections

<ui-menu-section title="Sort by">
  <ui-menu-item label="Name" />
  <ui-menu-item label="Date" />
</ui-menu-section>
<ui-menu-separator />
<ui-menu-section>
  <ui-menu-item label="Select" />
</ui-menu-section>
  • <ui-menu-section> groups items, under an optional title.
  • <ui-menu-separator /> parts two sections: a thin line, or a thick band before iOS 26.
<ui-menu-submenu label="Sort by" icon="arrow-down">
  <ui-menu-item
    label="Name"
    [checked]="sort() === 'name'"
    (pressed)="sort.set('name')"
  />
  <ui-menu-item
    label="Date"
    [checked]="sort() === 'date'"
    (pressed)="sort.set('date')"
  />
</ui-menu-submenu>
  • <ui-menu-submenu> is a row with a chevron that opens a nested menu. It takes what a menu does: items, sections, separators and further submenus.
  • It grows out of its row, over the menu it's in, with the row's label as its header, and the menu behind it fades, as iOS's submenus do. On Android's Material menus it unfolds in the menu's place, with a back arrow in the header.
  • A tap on the header, a tap outside the submenu, or Android's back button goes back to the menu it opened from. Choosing one of its items closes every menu.

API

UiMenu

InputTypeDefaultDescription
openbooleanfalseWhether the menu is open. Supports [(open)].
OutputTypeDescription
openChangebooleanEmits when the trigger, an item or a tap outside opens or closes it.
closedvoidEmits after the close animation finishes.
MethodDescription
toggle()Opens or closes the menu.
close()Closes the menu.

UiMenuTrigger

Selector: [uiMenuTrigger]. Put it on the element inside <ui-menu> that opens it. Without one, the menu grows out of <ui-menu>'s own element.

UiMenuItem

InputTypeDefaultDescription
labelstring(required)The item's text.
iconIconName—An icon from the icon set. Give this or svg.
svgstring—SVG markup to draw instead, with currentColor in the item's color.
variant'default' | 'destructive''default'destructive colors it red.
checkedboolean—Shows a checkmark when true. Set it on every item of a group of options.
disabledbooleanfalseShows the item without letting it be chosen.
accessibilityLabelstring—What a screen reader reads instead of the label and, if destructive, ", destructive".
OutputTypeDescription
pressedvoidEmits when the item is chosen, before the menu closes.

Items, sections, separators and submenus work in a <ui-menu> and in a <ui-context-menu>.

UiMenuSubmenu

InputTypeDefaultDescription
labelstring(required)The row's text, and the submenu's header.
iconIconName—An icon for the row, from the icon set.
disabledbooleanfalseShows the row without letting it open the submenu.
MethodDescription
expand()Opens the submenu.
collapse()Closes the submenu, back to the menu it's in.
close()Closes the submenu and every menu it's in.

UiMenuSection

InputTypeDefaultDescription
titlestring—A title above the section's items.

UiMenuSeparator

No inputs.

Theme colors

The menu reads glass-foreground and glass-muted-foreground (text and icons) and glass-dim (a context menu's dimming layer). See Glass.

Accessibility

  • Each item is a button named by its label. A destructive item reads as "Delete, destructive". accessibilityLabel replaces both.
  • A checked item is selected, which VoiceOver reads on iOS.
  • Section titles are headings.
  • A submenu's row and its header are buttons named by its label. When the submenu opens, a screen reader moves into it.
  • When the menu opens, a screen reader moves into it and stays inside until it closes, reading the items in order.
  • Reduce Motion: the menu doesn't grow or shrink. It appears in place, and its items fade in.
  • Reduce Transparency and Increase Contrast apply as on all glass.