Import

import-menu.ts
import {
NuiMenu,
NuiMenuItem,
NuiMenuSeparator,
NuiMenuShortcut,
NuiMenuTrigger,
} from '@needless-ui/angular/menu';

NuiMenuTrigger

Opens a menu. Usually applied to a nuiButton.

Selector
[nuiMenuTrigger]
Exported as
nuiMenuTrigger
NuiMenuTrigger: Properties
NameTypeDefaultDescription
nuiMenuTriggerInputMenuThe menu to open: the ngMenu reference of a nuiMenu.

NuiMenu

A menu of items, rendered as a popover next to its trigger. Its ngMenu export is the Angular Aria menu that triggers and submenus take.

Selector
[nuiMenu]
Exported as
ngMenu
NuiMenu: Properties
NameTypeDefaultDescription
wrapInputbooleantrueWhether arrow keys wrap from the last item to the first.
typeaheadDelayInputnumber500Milliseconds before the typeahead search resets.
disabledInputbooleanfalseDisables the whole menu.
enterInputNuiEnterHow it arrives: zoom, fade, drop, rise, unfold, flip, swing, slide or none.
motionInputNuiMotionThe spring it moves with: snappy, bouncy, jelly, elastic, lazy, mechanical or none.
springInputNuiSpringAny spring, as { stiffness, damping, mass }, compiled to CSS at runtime. It overrides motion.
cornersInputNuiCornersThe shape of its corners: round, squircle, bevel, scoop, notch or square.
radiusInputNuiRadiusHow big its corners are: none, small, medium, large or full.
densityInputNuiDensityHow much room it takes: compact, regular or roomy.
itemSelectedOutputVEmits the value of the chosen item. On the root menu it fires for submenu items too.

Customization inputs you leave unset follow the nearest data-nui-* attribute. See the customization guide.

NuiMenuItem

An item in a nuiMenu.

Selector
[nuiMenuItem]
NuiMenuItem: Properties
NameTypeDefaultDescription
valueInputVIdentifies the item. Must be unique across the whole menu, submenus included.
disabledInputbooleanfalseDisables the item. It stays reachable with the arrow keys but can’t be chosen.
submenuInputMenuA nested nuiMenu that this item opens.
roleInput'menuitem' | 'menuitemcheckbox' | 'menuitemradio''menuitem'menuitem, menuitemcheckbox or menuitemradio.
checkedInputboolean | undefinedChecked state of a checkbox or radio item.
toneInput'neutral' | 'danger''neutral'danger for destructive actions.
searchTermInputstringText matched by typeahead. Defaults to the item’s label.
selectedOutputVEmits the item’s value when it’s chosen with the mouse or the keyboard.

NuiMenuSeparator

A line between groups of items.

Selector
[nuiMenuSeparator]

NuiMenuShortcut

A keyboard shortcut hint, aligned to the end of an item.

Selector
[nuiMenuShortcut]