Overview
TheMtPopover component creates a floating panel that displays contextual actions, settings, or information. It supports nested navigation views, custom positioning, and can be used with or without floating-ui positioning.
Import
Props
The title displayed in the popover header.
An array of child view configurations for nested navigation. Each view can have:
name(string): Unique identifier for the viewtitle(string, optional): Title displayed when navigating to this viewchildViews(View[], optional): Nested child views
When true, disables floating-ui positioning and renders as a static container.
The width of the popover:
dynamic: 220px - 440px (adjusts to content)large: 340px fixedmedium: 280px fixedsmall: 220px fixed
Usage
Basic Popover
Nested Views
With Switches and Toggles
Static Popover (No Floating)
Slots
The trigger element that opens/closes the popover.Slot Props:
isOpened(boolean): Current open statetoggleFloatingUi(function): Function to toggle the popover
The main content area for the popover when in the base view.Slot Props:
changeView(function): Function to navigate to a child viewtoggleFloatingUi(function): Function to close the popover
Content for a specific child view. Replace
[viewName] with the view’s name.Slot Props:changeView(function): Function to navigate to another viewtoggleFloatingUi(function): Function to close the popover
Events
Emitted when the popover opens or closes. Passes the new state (boolean).
View Navigation
The popover supports nested view navigation:- Define child views using the
childViewsprop - Use
changeView(viewName)to navigate to a specific view - A back button automatically appears in child views
- Each view can have its own title and nested children
Working with MtPopoverItem
TheMtPopoverItem component is used within popover slots to create interactive list items. Common props include:
label: The item texticon: Icon name to displayshowCheckbox: Display a checkboxshowSwitch: Display a toggle switchshowOptions: Display an options/chevron buttonshowVisibility: Display a visibility togglemetaCopy: Descriptive text below the labelcontextualDetail: Right-aligned detail textshortcut: Keyboard shortcut displayborderTop/borderBottom: Add border separatorstype: Set to ‘critical’ for destructive actions
Working with MtPopoverItemResult
TheMtPopoverItemResult component is specialized for displaying grouped, draggable lists with visibility controls (commonly used for column management).
Props:
groups: Array of group configurationsoptions: Array of items to displaydraggable: Enable drag-and-drop reorderinghidable: Enable visibility toggles
change-visibility: Emitted when an item’s visibility changeschange-order: Emitted when items are reorderedclick-group-action: Emitted when a group action is clicked
Accessibility Features
- Keyboard Navigation: Full keyboard support within popover items
- ARIA Attributes:
role="dialog"for proper screen reader support - Focus Management: Focus returns to trigger when closed
- Escape Key: Press Escape to close the popover
- Click Outside: Clicking outside closes the popover (when using floating-ui)
Animations
The popover includes smooth slide animations when navigating between views:- Slide-in animation when navigating forward
- Slide-out animation when navigating back
- Smooth height transitions using
mt-smooth-reflow
Best Practices
- Use descriptive titles: Provide clear titles for each view
- Limit nesting depth: Avoid more than 2-3 levels of nested views
- Group related items: Use border separators to group related actions
- Mark destructive actions: Use
type="critical"for delete or destructive operations - Provide context: Use
metaCopyto explain non-obvious actions - Choose appropriate width: Use fixed widths for consistent layouts, dynamic for varying content