Skip to content
LIBRARYFeedbackUpdated

Popover ​

Alpha.10

Available in Mavis alpha.11 for Vue Web and NativeScript. Keep core and renderer versions aligned.

Web preview
Open example ↗
vue
<MPopover v-model:open="open" label="Filters" triggerLabel="Filters">…</MPopover>
PropertyTypeDefaultDescription
open / v-model:openbooleanfalseApp-owned visibility.
label / triggerLabelstringrequiredAccessible panel name and visible trigger text.
placementbottom-start / bottom-end / top-start / top-endbottom-startPreferred anchor alignment; flips and clamps when needed.
widthnumber280Preferred CSS-pixel/DIP panel width.
paddingtoken / numbermdPanel spacing.
disabledbooleanfalsePrevents opening and requests closure.

An anchored surface for filters and small forms. The component owns its trigger, positioning and return focus. The default slot receives close(). update:open requests visibility changes; close(reason) identifies trigger, outside, Escape, Android back, selection or programmatic requests. opened runs after presentation. Web follows anchor/viewport size, scroll and RTL; native dismisses on ancestor scrolling. Escape/outside interaction closes the surface; native Android back participates in the installed navigation back claimant. Native requires an MScreen ancestor. Panels stay within the safe viewport; use Sheet for a long or full-screen workflow. Popover is nonmodal on Web; native presents a modal accessibility layer over its screen. Web Tab can leave the panel. Open panels are deferred until client mount during SSR. Theme and dependency injections remain those of the declaration.

A built-in trigger keeps its panel open when NativeScript reports the same scroll offset again. Moving the parent scroll view dismisses the panel.

Motion ​

The panel grows out of its trigger with the theme's spring: its pivot sits where the trigger meets the panel, so a panel below the trigger unfolds downward and one that flipped above unfolds upward. Closing shrinks it back toward the trigger. Placement measures the panel's layout size, so the entrance never shifts where it lands. A theme without press scale only fades, and reduced motion keeps the fade without the growth.

vue
<script setup lang="ts">
import { computed, ref } from 'vue'
import { useCatalogLocale } from '../locale'
const props = defineProps<{ lang?: 'en' | 'pt' }>()
const { locale } = useCatalogLocale(() => props.lang)
const pt = computed(() => (props.lang ?? locale.value) === 'pt')
const t = (en: string, br: string) => (pt.value ? br : en)
const open = ref(false)
const query = ref('')
</script>

<template>
  <MColumn gap="md">
    <MText
      as="h2"
      variant="heading"
      :text="t('A little more context', 'Um pouco mais de contexto')"
    />
    <MPopover
      v-model:open="open"
      :label="t('Refine the collection', 'Refinar a coleção')"
      :triggerLabel="t('Filters', 'Filtros')"
      icon="sliders-horizontal"
    >
      <template #default="{ close }">
        <MColumn gap="md"
          ><MInput v-model="query" :label="t('Search', 'Buscar')" /><MButton
            :text="t('Apply filters', 'Aplicar filtros')"
            @click="close"
        /></MColumn>
      </template>
    </MPopover>
    <MText
      id="popover-query"
      :text="query || t('Your collection, your way.', 'Sua coleção, do seu jeito.')"
      tone="muted"
    />
  </MColumn>
</template>

The optional anchor slot replaces the built-in trigger with application-owned content. Control open from your application. It keeps that content mounted; Web restores focus to its first focusable descendant when appropriate. Native follows ancestor scrolling for custom anchors, which lets MTourTarget reveal a section without dismissing its guide.

Desktop ​

MPopover opens inside the window beside its trigger or anchor, the same on the Mac and on Windows, and stays within the window; Escape and a click outside close it, and the keyboard returns to the trigger. See Desktop components.

Components for NativeScript and Web. Starting with Vue.