Skip to content
LIBRARYNavigation

Tour ​

Included in RC.12

Available in Mavis 0.1.0-rc.12 for Vue + Vite, Nuxt and NativeScript. Keep the Mavis packages at the same version.

Web preview
Open example ↗
vue
<MTour v-model="step" :steps="steps" label="Getting started">
  <MTourTarget name="editor"><MInput v-model="name" label="Name" /></MTourTarget>
</MTour>
PropTypeDefaultContract
stepsreadonly TourStep[]requiredUnique id, title and description. id matches MTourTarget.name.
modelValuestring | nullnullCurrent step id; null closes the tour.
animatedbooleantrueOptional target instruction feedback, alongside Popover motion.
spotlightbooleanfalseDims the other targets while a step is shown.
nextLabel / backLabel / skipLabel / finishLabelstringEnglishLocalized navigation actions.
MTourTarget.namestringrequiredA unique target within the enclosing tour.

Wrap existing content in MTourTarget; it remains mounted throughout the tour. Targets are explicit shared components, without document selectors. The active target gets an outline, is revealed in its scroll container and owns an anchored Popover. Missing targets emit missing(id) and propose the next registered step. finish(reason) distinguishes complete, skip, missing and Popover dismissal. Closing restores prior focus where the platform permits. Web is non-modal; native Popover uses its native overlay. There is no dimmed mask with a cutout: spotlight only lowers the opacity of the other targets, which stay usable.

With animated, the outline is a ring that fades in and settles on the current target, the step title and description arrive one after the other, and dots beside the step count mark progress. Only opacity and the ring move, so a target that holds focus stays still. Reduced motion keeps the fades without travel.

Native layout ​

A custom target gives its anchored content the card’s available width. The heading can wrap, and the trip-name field stays inside the card. Each screenshot pair shows Mavis on the left and Midnight on the right.

iPhone 17 Pro simulator, iOS 26.2

iPhone 17 Pro simulator, iOS 26.2 · Tour

Android API 36 emulator

Android API 36 emulator · Tour

The native probe opens the tour, advances one step and dismisses it in both themes.

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 step = ref<string | null>(null),
  draft = ref('Weekend away'),
  finished = ref('')
const steps = computed(() => [
  {
    id: 'name',
    title: t('Give it a name.', 'Dê um nome.'),
    description: t(
      'Your next story begins with a few words. Your draft stays right here.',
      'Sua próxima história começa com algumas palavras. Seu rascunho fica aqui.',
    ),
  },
  {
    id: 'route',
    title: t('Choose the unexpected.', 'Escolha o inesperado.'),
    description: t(
      'Collect the places you want to discover along the way.',
      'Guarde os lugares que você quer descobrir pelo caminho.',
    ),
  },
  {
    id: 'invite',
    title: t('Good company, great stories.', 'Boa companhia, grandes histórias.'),
    description: t(
      'Bring someone along. You are ready to begin.',
      'Leve alguém com você. Está tudo pronto para começar.',
    ),
  },
])
function start() {
  step.value = 'name'
  finished.value = ''
}
</script>
<template>
  <MColumn gap="lg"
    ><MText text="FIRST STEPS / A WARM WELCOME" variant="overline" tone="primary" /><MButton
      id="tour-start"
      :text="t('Show me around', 'Me mostre por aqui')"
      @click="start" /><MTour
      v-model="step"
      :steps="steps"
      :label="t('A new adventure', 'Uma nova aventura')"
      :nextLabel="t('Next', 'Próximo')"
      :backLabel="t('Back', 'Voltar')"
      :skipLabel="t('End tour', 'Encerrar tour')"
      :finishLabel="t('Finish', 'Concluir')"
      spotlight
      @finish="finished = $event"
      ><MColumn gap="lg"
        ><MTourTarget name="name"
          ><MCard id="tour-name-card" gap="md"
            ><MText
              id="tour-name-title"
              :text="
                t('Your little escape for the weekend.', 'Sua pequena escapada de fim de semana.')
              "
              variant="title" /><MInput
              id="tour-name-field"
              v-model="draft"
              :label="t('Trip name', 'Nome da viagem')" /></MCard></MTourTarget
        ><MTourTarget name="route"
          ><MCard gap="md"
            ><MText
              :text="t('A trail worth following.', 'Uma trilha que vale seguir.')"
              variant="heading" /><MText
              :text="
                t(
                  'Three days. A different pace. Room for detours.',
                  'Três dias. Outro ritmo. Espaço para desvios.',
                )
              " /><MButton
              :text="t('Explore routes', 'Explorar rotas')"
              variant="secondary" /></MCard></MTourTarget
        ><MTourTarget name="invite"
          ><MCard gap="md"
            ><MText :text="t('Better together.', 'Melhor juntos.')" variant="heading" /><MButton
              :text="t('Invite a friend', 'Convidar alguém')"
              icon="plus" /></MCard></MTourTarget></MColumn></MTour
    ><MText id="tour-result" :text="finished || '—'" variant="caption"
  /></MColumn>
</template>

Desktop ​

MTour shows each step in a panel beside its MTourTarget, scrolling the target into view, and gives the keyboard back to where it was when the tour ends, the same on the Mac and on Windows. See Desktop components.

Components for NativeScript and Web. Starting with Vue.