Marquee
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.
<MMarquee :items="reminders" label="Small reminders" v-model:paused="paused" :speed="35" />| Prop | Type | Default | Contract |
|---|---|---|---|
items | readonly MarqueeItem[] | required | Unique id, label and optional image; content is noninteractive. |
autoplay / paused | boolean | false / false | Autoplay is opt-in. paused can be controlled with v-model:paused. |
speed / direction | number / left | right | 35 / left | Pixels/DIPs per second, in (0,500]. |
itemWidth / gap | number | 180 / 16 | Fixed item width >=80 and nonnegative spacing. |
playLabel / pauseLabel | string | English | Always-visible motion control labels. |
fade | boolean | true | Web: softens both edges while the strip moves. No effect on native. |
Jolt owns linear playback and pause/resume. Decorative repeated copies are hidden from accessibility. Motion starts only on request; reduced motion always produces a static wrapping list. Web pauses on hover/focus, page hiding and leaving the viewport; native pauses on application suspension and unload. KeepAlive/disposal releases observers and playback. No links or interactive slots are duplicated.
While the strip moves on Web, both edges fade softly into the background with a CSS mask, so items glide in and out instead of being cut; a still or reduced-motion list has no mask. Set fade to false to keep hard edges. NativeScript keeps hard edges. The play/pause control shows a matching glyph that pops when it switches; its accessible name is still the label.
<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 paused = ref(false),
autoplay = ref(false),
fade = ref(true),
speed = ref(35)
const direction = ref<'left' | 'right'>('left')
const items = computed(() => [
{ id: 'wander', label: t('Wander often.', 'Explore sempre.') },
{ id: 'notice', label: t('Notice the details.', 'Perceba os detalhes.') },
{ id: 'wonder', label: t('Stay curious.', 'Siga curioso.') },
{ id: 'create', label: t('Make something.', 'Crie algo.') },
])
</script>
<template>
<MColumn gap="lg"
><MText text="COMMON GROUND / IDEAS IN MOTION" variant="overline" tone="primary" /><MText
:text="t('A few words to live by.', 'Algumas palavras para levar.')"
variant="display" /><MMarquee
id="reminder-marquee"
v-model:paused="paused"
:items="items"
:autoplay="autoplay"
:speed="speed"
:direction="direction"
:fade="fade"
:label="t('Small reminders', 'Pequenos lembretes')"
:playLabel="t('Play motion', 'Iniciar movimento')"
:pauseLabel="t('Pause motion', 'Pausar movimento')" /><MCard gap="md"
><MSlider v-model="speed" :min="15" :max="100" :label="t('Speed', 'Velocidade')" /><MSwitch
v-model="autoplay"
:label="t('Start automatically', 'Iniciar automaticamente')" /><MSwitch
v-model="fade"
:label="t('Fade the edges', 'Suavizar as bordas')" /><MButton
:text="t('Reverse direction', 'Inverter direção')"
variant="secondary"
@click="direction = direction === 'left' ? 'right' : 'left'" /><MText
:text="
t(
'Motion is optional. Hover or focus the strip to pause it.',
'Movimento é opcional. Passe o cursor ou foque a faixa para pausar.',
)
"
tone="muted" /></MCard
></MColumn>
</template>The strip repeats as one continuous linear playback. Its play and pause controls apply to the whole strip, including subsequent passes.
Desktop
The strip moves through the Jolt desktop drivers inside a clipped row, holds still while the pointer is over it and stays a still wrapping list under reduced motion. The strip also stops while the window is minimized or covered on the Mac, or hidden on Windows, and goes on from where it was. The edges stay hard (fade has no effect) and Windows does not clip yet, so there the moving strip can be drawn past the edges of its row. See Desktop components.