Popover
Experimental. The API may still change. Prefer Action Menu or Floating UI when they fit your use case.
Usage
Popover is an experimental floating surface that reveals contextual settings and nested option views from a trigger. Prefer Action Menu when you need a standard menu of actions or options, or Floating UI when you need a custom floating surface with your own layout, content, or interaction behavior, and reach for Popover only when neither already fits the use case.
import {
MtPopover,
MtPopoverItem,
MtPopoverItemResult,
} from "@shopware-ag/meteor-component-library";
Anatomy
Popover is built from a small set of companion exports that work together:
mt-popoverrenders the floating surface, its header, and the view transitions, and exposes the trigger and item slots.mt-popover-itemrenders a single row inside a view, with optional icon, switch, checkbox, options affordance, or nested view trigger.mt-popover-item-resultrenders a grouped, draggable list of options, such as a column visibility and ordering editor.
These parts are exported together so the pattern can be composed in one place.
API reference
Props
| Prop | Type | Default |
|---|---|---|
width | "small" | "auto" | "medium" | "large" | "dynamic" |
title | string | "" |
child-views | View[] | [] |
disable-float | boolean | false |
Events
| Event | Payload |
|---|---|
update:isOpened | any[] |
Exposed
| Name | Type |
|---|---|
goViewBack | () => void |
currentView | View |
activeView | string |
changeView | (view: string) => void |
allViews | View[] |
viewTransition | "slideIn" | "slideOut" |
MtPopover | HTMLElement | null |
closeFloatingUi | () => void |
toggleFloatingUi | () => void |
isOpened | boolean |
mainComponentTag | "div" | "mt-floating-ui" |
componentClasses | { [x: string]: boolean; "mt-popover--float": boolean; "is--open": boolean; "has--header": boolean; } |
showHeader | boolean |
Best practices
Do
- Reach for Action Menu or Floating UI first, and use Popover only when neither fits.
- Keep the trigger labelled clearly so users understand what the surface contains.
- Use views and nested views to keep each step focused instead of overloading a single list.
Don't
- Do not use Popover for the main action on a screen.
- Do not nest views more deeply than the task requires.
- Do not rely on icons or color alone to explain what an item does.
Behavior
- The
#triggerslot exposestoggleFloatingUi, which opens and closes the surface. Stop click propagation on the trigger so the open click does not immediately close it. - Items render inside named view slots such as
#popover-items__base. Additional views are declared throughchildViewsand rendered in matching#popover-items__<name>slots. - The view slots expose
changeView, which navigates to a named view. The header shows a back button automatically for any view other thanbase. disableFloatrenders the content inline as a plain container instead of a floating surface, which is useful for embedding the panel without a trigger.widthacceptsdynamic,small,medium, orlargeto constrain the surface width.
Accessibility
- Provide a clear accessible name on the trigger so users understand what the surface contains.
- Item labels should stay understandable without depending only on icons or color.
- The surface uses a dialog role, so keep focus behavior predictable when it opens and closes.
Related components
- Action Menu: when you need a short, scannable list of actions or options.
- Floating UI: when you need a custom floating surface with your own layout, content, or interaction behavior.