Usage
Action Menu reveals a short list of contextual actions for a specific record, card, row, or view. Use it for secondary actions like Duplicate, Move, Export, or Delete that should stay available without claiming permanent visual priority.
import { MtActionMenu } from "@shopware-ag/meteor-component-library";
Examples
Without icons
Grouped items
Use groups to separate related action sets and keep scanning easy.
Keyboard shortcuts
States
Nested submenu
External links
An item with a link prop renders as an external anchor and opens in a new tab.
Match trigger width
Anatomy
Action Menu is built from a small set of companion exports that work together:
mt-dropdown-menu-rootmanages the open and closed state for the menu.mt-dropdown-menu-triggerdefines the interactive element that opens the menu, usually a Button.mt-dropdown-menu-portalrenders the menu content in an overlay layer outside the surrounding layout flow.mt-action-menurenders the menu surface itself.mt-action-menu-itemrenders individual actions, links, shortcuts, and submenu triggers.mt-action-menu-groupseparates related actions and keeps mixed icon alignment consistent inside a group.mt-dropdown-menu-subcreates nested submenu flows when a second level is truly needed.
These parts are exported together so the pattern can be composed in one place.
API reference
The mt-action-menu-* components wrap Reka UI's Dropdown Menu primitives and forward any additional attributes to them. The tables below therefore list the props each wrapper declares itself, followed by the forwarded Reka UI props and events you can also use. The mt-dropdown-menu-* parts are direct re-exports of the Reka UI primitives.
MtActionMenu
Props
| Prop | Type | Default |
|---|---|---|
is-sub-menu | false | true | false |
match-trigger-widthWhen enabled, the menu content will match the trigger's width using Reka UI's CSS variables.
Also constrains max-height to available viewport space. | false | true | false |
Slots
| Slot | Bindings |
|---|---|
default | {} |
Forwarded Reka UI props
mt-action-menu renders Reka UI's DropdownMenuContent (DropdownMenuSubContent when is-sub-menu is set) and forwards all additional attributes to it. The most useful forwarded props:
| Prop | Type | Default |
|---|---|---|
side | "top" | "right" | "bottom" | "left" | "bottom" |
side-offset | number | 8 (set by mt-action-menu) |
align | "start" | "center" | "end" | "start" (set by mt-action-menu) |
align-offset | number | 0 (-5 for submenus) |
avoid-collisions | boolean | true |
collision-padding | number | object | 0 |
collision-boundary | Element | Element[] | null | [] |
sticky | "partial" | "always" | "partial" |
hide-when-detached | boolean | false |
position-strategy | "absolute" | "fixed" | "fixed" |
update-position-strategy | "optimized" | "always" | "optimized" |
prioritize-position | boolean | false |
reference | Element | VirtualElement | — |
loop | boolean | false |
force-mount | boolean | — |
Forwarded events: @escape-key-down, @pointer-down-outside, @focus-outside, @interact-outside, and @close-auto-focus.
Attributes you pass take precedence over the defaults mt-action-menu sets, so side-offset and align can be overridden. Exception: submenus (is-sub-menu) position themselves automatically, so side and align have no effect there.
MtActionMenuItem
Props
| Prop | Type | Default |
|---|---|---|
variant | "default" | "critical" | "default" |
icon | string | undefined |
disabled | false | true | false |
shortcut | ShortcutDefinition | undefined |
is-sub-trigger | false | true | |
as | string | Component | undefined |
link | string | undefined |
Slots
| Slot | Bindings |
|---|---|
default | {} |
Forwarded Reka UI props
mt-action-menu-item renders Reka UI's DropdownMenuItem (DropdownMenuSubTrigger when is-sub-trigger is set) and forwards all additional attributes to it:
| Prop / Event | Type | Description |
|---|---|---|
@select | (event: Event) => void | Fires when the action is selected via click or keyboard. Call event.preventDefault() to keep the menu open after the selection. |
text-value | string | Overrides the text used for typeahead matching when the visible label is not plain text. |
as-child | boolean | Merges the item behavior into its child element instead of rendering its own element. |
@select is not emitted for is-sub-trigger items, because sub-triggers open a submenu instead of performing an action.
MtActionMenuGroup
Slots
| Slot | Bindings |
|---|---|
default | {} |
mt-action-menu-group renders Reka UI's DropdownMenuGroup and additionally accepts its as and as-child props.
MtDropdownMenuRoot
Re-export of Reka UI's DropdownMenuRoot. It manages the open state for the whole menu.
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state, usable as v-model:open. |
default-open | boolean | false | Initial open state when uncontrolled. |
modal | boolean | true | When true, interaction with elements outside the menu is blocked and page scrolling is locked while it is open. |
dir | "ltr" | "rtl" | — | Reading direction. |
Emits update:open and exposes the current state through the default slot binding { open }.
MtDropdownMenuTrigger
Re-export of Reka UI's DropdownMenuTrigger. Accepts as, as-child, and disabled. Use as-child to turn an existing element, such as a Button, into the trigger.
MtDropdownMenuPortal
Re-export of Reka UI's DropdownMenuPortal. Accepts to (teleport target, defaults to body), disabled, defer, and force-mount.
MtDropdownMenuSub
Re-export of Reka UI's DropdownMenuSub. Wraps a nested submenu and accepts open (v-model:open) and default-open, emits update:open, and exposes { open } through its default slot.
Best practices
- Keep labels short, specific, and action-oriented.
- Prioritize frequent actions and place destructive actions later in the menu.
- Keep action ordering consistent across similar contexts.
- Keep the menu focused on related actions for the same object or context.
- Use
mt-action-menu-groupto separate action sets when grouping improves scanning. - Separate destructive actions into their own group when they appear alongside non-destructive actions.
- Use the
criticalvariant for destructive actions such as delete or remove. - Keep icon usage consistent within a visual group whenever possible.
- Use
shortcutonly when the same action is also available from the keyboard elsewhere in the product.
- Do not use Action Menu for the main action on a screen or card.
- Do not hide critical task-completion steps only inside an Action Menu.
- Do not group unrelated actions or create groups without a clear purpose.
- Do not create deep or complex hierarchies when a flatter structure would be easier to scan.
- Do not overuse groups or create many single-item groups when a flatter list would scan better.
- Do not use icons, groups, or separators unless they add clarity.
- Do not rely on color, icons, or shortcut labels alone to explain what an action does.
Behavior
- Action Menu is a compound pattern, not a standalone trigger. It is always composed from the companion exports listed in Anatomy.
shortcutaccepts a structured object withmodifiersandkey.- Supported modifier values are
mod,ctrl,alt,shift, andmeta. - Use
modfor cross-platform shortcuts because it maps toCommandon Mac andControlon Windows and Linux. Usemetaonly when you need the platform-specific meta key explicitly. - Supported special keys are
enter,esc,tab,space,backspace,delete,up,down,left, andright. - Shortcut labels are formatted automatically for Mac and PC, and
aria-keyshortcutsis added for assistive technology. - An
mt-action-menu-itemwith alinkprop renders as an external anchor and opens in a new tab. is-sub-menuonmt-action-menuandis-sub-triggeronmt-action-menu-itemare used together for nested submenu patterns.match-trigger-widthis useful when the menu should align visually with a wider trigger such as a row action or account switcher.- Keep nesting shallow. One submenu level is usually enough, and more than two levels should be avoided.
Accessibility
- The trigger should have a clear accessible name so users understand what actions the menu contains.
- Menu item labels should stay understandable without depending only on icons, color, or shortcut labels.
- If you provide
shortcut, it supplements the action label rather than replacing it. - Destructive actions should remain clearly labeled in text, not only visually differentiated through the
criticalvariant. - Use submenu patterns carefully, because deep menu hierarchies are harder to navigate with keyboard and assistive technology.
Related components
- Floating UI: when you need a custom popover surface with richer content such as text, filters, form fields, or mixed layout content instead of a menu of actions.