Skip to content

Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Documentation navigation

Components / Display

Marquee

A seamless, pausable looping ticker for logos, quotes, or announcements that stops under reduced motion.

Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.

Interactive showcase

VueNuxtTailwind CSS

Install

Run in your project
bunx --bun @getweini/cli@latest add marquee

Start with this example

Import the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.

VueNuxtTailwind CSS
Vue
<script setup lang="ts">
import Marquee from './components/ui/marquee/Marquee.vue'

const frameworks = [
  { name: 'Weini', href: '/', src: '/frameworks/weini.svg' },
  { name: 'Vue', href: 'https://vuejs.org/', src: '/frameworks/vue.svg' },
  { name: 'Nuxt', href: 'https://nuxt.com/', src: '/frameworks/nuxt.svg' },
  { name: 'Tailwind CSS', href: 'https://tailwindcss.com/', src: '/frameworks/tailwind.svg' },
]
</script>

<template>
  <Marquee aria-label="Frameworks and tools" gap="1.5rem" class="w-full max-w-lg">
    <a
      v-for="framework in frameworks"
      :key="framework.name"
      :href="framework.href"
      :aria-label="framework.name"
      target="_blank"
      rel="noopener noreferrer"
      class="inline-flex size-12 shrink-0 items-center justify-center rounded-ui text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
    >
      <span
        v-if="framework.name === 'Weini'"
        aria-hidden="true"
        class="size-12 bg-current [mask:url('/frameworks/weini.svg')_center/contain_no-repeat]"
      />
      <img
        v-else
        :src="framework.src"
        :alt="framework.name"
        width="48"
        height="48"
        class="size-12 object-contain"
      >
    </a>
  </Marquee>
</template>

Place items inside the marquee. It duplicates them for a seamless loop and measures the duration from speed, which defaults to 20 pixels per second. The primary example uses the docs site's /frameworks/*.svg logo assets; those paths belong to the docs app and can be replaced with your own image URLs. Each image includes fixed dimensions to prevent layout shift and meaningful alt text; the cloned loop stays hidden from assistive technology.

When to use it

Logo strips

Show customers or partners in a continuous row.

Announcements

Scroll short news or quotes vertically in a fixed-height area.

More examples

Controlled pause

Bind v-model:paused to a visible pause button. Moving content over five seconds needs a pause mechanism (WCAG 2.2.2).

Controlled pause
<script setup lang="ts">
import { ref } from 'vue'
import Button from './components/ui/button/Button.vue'
import Marquee from './components/ui/marquee/Marquee.vue'

const paused = ref(false)
const headlines = ['Release 0.7 is out', 'New components ship today', 'Docs now cover RTL']
</script>

<template>
  <div class="grid w-full max-w-lg gap-3">
    <Marquee v-model:paused="paused" aria-label="Latest news" :speed="60" gap="2rem">
      <span v-for="line in headlines" :key="line" class="text-sm">{{ line }}</span>
    </Marquee>
    <Button variant="outline" size="sm" class="justify-self-start" @click="paused = !paused">
      {{ paused ? 'Resume news ticker' : 'Pause news ticker' }}
    </Button>
  </div>
</template>

Vertical and reversed

Give the marquee a height and set orientation and reverse.

Vertical and reversed
<script setup lang="ts">
import Marquee from './components/ui/marquee/Marquee.vue'

const quotes = [
  '"Fast to adopt."',
  '"Easy to restyle."',
  '"Accessible by default."',
  '"Great docs."',
]
</script>

<template>
  <Marquee orientation="vertical" reverse :speed="30" gap="1rem" class="h-40 w-64">
    <p v-for="quote in quotes" :key="quote" class="rounded-ui bg-muted px-4 py-2 text-sm">
      {{ quote }}
    </p>
  </Marquee>
</template>

Complete API

Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.

Marquee

Complete API for Marquee
NameType or signatureDefaultWhat it does
speedpropnumber | undefined20Scroll speed in pixels per second. Defaults to 20.
reversepropboolean | undefinedNot setMove toward inline end horizontally, or toward the bottom vertically.
pauseOnHoverpropboolean | undefinedtruePause while the pointer or focus is inside.
gappropstring | undefined"1rem"Space between items and between the two loops, as any CSS length.
orientationprop"horizontal" | "vertical" | undefined"horizontal"Arrange items horizontally or vertically.
pausedmodelboolean | undefinedfalseCurrent paused value. Use the matching v-model binding to update it.
update:pausedevent[value: boolean]—Requests a new paused value from the parent.
defaultslot(() => unknown) | undefinedOptionalContent shown inside Marquee.
pausedexposedboolean—Access paused from a component template ref.
toggleexposed() => void—Access toggle from a component template ref.
Public type definitions
Public types
// packages/frameworks/vue/components/marquee/types.ts
// ------- TYPES -------

export interface MarqueeProps {
  /** Scroll speed in pixels per second. Defaults to 20. */
  speed?: number
  /** Move toward inline end horizontally, or toward the bottom vertically. */
  reverse?: boolean
  /** Pause while the pointer or focus is inside. */
  pauseOnHover?: boolean
  /** Space between items and between the two loops, as any CSS length. */
  gap?: string
  orientation?: 'horizontal' | 'vertical'
}

Implementation notes

  • The loop is a GPU transform on two tracks; the second track is an aria-hidden, inert clone.
  • Hovering or focusing inside pauses it unless pause-on-hover is off.
  • Do not give slot children fixed ids, since the slot renders twice.

Accessibility and localization

  • WCAG 2.2.2: auto-moving content that lasts more than 5 seconds needs a pause mechanism. Provide a pause button with v-model:paused.
  • Under prefers-reduced-motion: reduce the marquee is a static wrapped row with no duplicate content.
  • Give the marquee an aria-label when it needs a distinct accessible name; a named marquee exposes role="group".

Source contract and editing guidance