Изучите Nuxt с коллекцией из 100+ советов!

marquee
marquee

A lightweight Nuxt 3 module that harnesses the power of CSS animations to create silky smooth marquees.

Nuxt Marquee

A lightweight Nuxt 3 component that harnesses the power of CSS animations to create silky smooth marquees.

nuxt-marquee

Installation

npx nuxi@latest module add marquee

Usage

To use this module, add it to the modules section of your nuxt.config.ts file.

export default defineNuxtConfig({
  // ..
  modules: ["nuxt-marquee"],
});

Example

<template>
  <NuxtMarquee>
    <MyComponent />
    <MyComponent />
    <MyComponent />
  </NuxtMarquee>
</template>

Props

PropertyTypeDefaultDescription
styleCSSProperties{}Inline style for the container div
classany""Name of the css class to style the container div
autoFillbooleanfalseWhether to automatically fill blank space in the marquee with copies of the children or not
playbooleantrueWhether to play or pause the marquee
pauseOnHoverbooleanfalseWhether to pause the marquee when hovered
pauseOnClickbooleanfalseWhether to pause the marquee when clicked
direction"left" | "right"| "up"| "down""left"The direction the marquee slides

Warning: Vertical marquees are currently experimental and may be buggy. Please swap the values of the marquee's height and width when setting them
speednumber50Speed calculated as pixels/second
delaynumber0Duration to delay the animation after render, in seconds
loopnumber0The number of times the marquee should loop, 0 is equivalent to infinite
gradientbooleanfalseWhether to show the gradient or not
gradientColorstringwhiteThe color of the gradient
gradientWidthnumber | string200The width of the gradient on either side

Events

Event NameDescription
finishEmitted when the marquee finishes scrolling and stops. Only calls if loop is non-zero.
cycleCompleteEmitted when the marquee finishes a loop. Does not call if maximum loops are reached (use onFinish instead).

License

MIT - Made with 💙 by Hànzy