Import
import {
NuiMenu,
NuiMenuItem,
NuiMenuSeparator,
NuiMenuShortcut,
NuiMenuTrigger,
} from '@needless-ui/angular/menu';NuiMenuTrigger
Opens a menu. Usually applied to a nuiButton.
| Name | Type | Default | Description |
|---|---|---|---|
nuiMenuTriggerInput | Menu | The 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.
| Name | Type | Default | Description |
|---|---|---|---|
wrapInput | boolean | true | Whether arrow keys wrap from the last item to the first. |
typeaheadDelayInput | number | 500 | Milliseconds before the typeahead search resets. |
disabledInput | boolean | false | Disables the whole menu. |
enterInput | NuiEnter | How it arrives: zoom, fade, drop, rise, unfold, flip, swing, slide or none. | |
motionInput | NuiMotion | The spring it moves with: snappy, bouncy, jelly, elastic, lazy, mechanical or none. | |
springInput | NuiSpring | Any spring, as { stiffness, damping, mass }, compiled to CSS at runtime. It overrides motion. | |
cornersInput | NuiCorners | The shape of its corners: round, squircle, bevel, scoop, notch or square. | |
radiusInput | NuiRadius | How big its corners are: none, small, medium, large or full. | |
densityInput | NuiDensity | How much room it takes: compact, regular or roomy. | |
itemSelectedOutput | V | Emits 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.
| Name | Type | Default | Description |
|---|---|---|---|
valueInput | V | Identifies the item. Must be unique across the whole menu, submenus included. | |
disabledInput | boolean | false | Disables the item. It stays reachable with the arrow keys but can’t be chosen. |
submenuInput | Menu | A nested nuiMenu that this item opens. | |
roleInput | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'menuitem' | menuitem, menuitemcheckbox or menuitemradio. |
checkedInput | boolean | undefined | Checked state of a checkbox or radio item. | |
toneInput | 'neutral' | 'danger' | 'neutral' | danger for destructive actions. |
searchTermInput | string | Text matched by typeahead. Defaults to the item’s label. | |
selectedOutput | V | Emits the item’s value when it’s chosen with the mouse or the keyboard. |
NuiMenuSeparator
A line between groups of items.
NuiMenuShortcut
A keyboard shortcut hint, aligned to the end of an item.