Overlays

Menu

@xui/menu

A list of commands, opened from a trigger. Built on the Angular CDK's menu primitives, so arrow-key navigation, typeahead, submenu aim, Escape and close-on-select all work — none of which jsdom exercises, so these stories are the real check.

Install

pnpm add @xui/menu

Add the barrel to a standalone component's imports:

import { XuiMenuImports } from '@xui/menu';

@Component({
  imports: [XuiMenuImports],
  // …
})

Examples

Default

Loading preview…

Selection

Loading preview…

Submenu

Loading preview…

Disabled

Loading preview…

API

XuiMenuDivider

componentxui-menu-divider

A rule between groups of menu items, with an optional heading.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the base classes.''titlestring | nullTurns the rule into a labelled section header.null

XuiMenuItem

componentbutton[xuiMenuItem], a[xuiMenuItem]

A command in a menu.

Variants

AxisOptionsDefaultcolornoneprimarysuccesswarningerrornone

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the variant classes.''iconstringName of a registered @ng-icons icon, shown in the left cell.selectedbooleanDraws a checkmark in the left cell — for a chosen option in a menu.falsecolorXuiMenuItemColorIntent colour of the item, for marking a destructive or otherwise notable action.this.config.itemColor

XuiMenuTrigger

directive[xuiMenuTriggerFor]

Opens a menu from the element it sits on.

XuiMenu

componentxui-menu

A list of commands, opened from a trigger.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the base classes.''

Source

libs/ui/menu/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.