Nuxt Marquee
A lightweight Nuxt 3 component that harnesses the power of CSS animations to create silky smooth marquees.
Installation
# if you're using npm npm i -D nuxt-marquee # if you're using yarn yarn add -D nuxt-marquee # if you're using pnpm pnpm i -D nuxt-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
PropertyTypeDefaultDescriptionstyleCSSProperties{}
Inline style for the container divclassany""
Name of the css class to style the container divautoFillbooleanfalse
Whether to automatically fill blank space in the marquee with copies of the children or notplaybooleantrue
Whether to play or pause the marqueepauseOnHoverbooleanfalse
Whether to pause the marquee when hoveredpauseOnClickbooleanfalse
Whether to pause the marquee when clickeddirection"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 themspeednumber50
Speed calculated as pixels/seconddelaynumber0
Duration to delay the animation after render, in secondsloopnumber0
The number of times the marquee should loop, 0 is equivalent to infinitegradientbooleanfalse
Whether to show the gradient or notgradientColorstringwhite
The color of the gradientgradientWidthnumber | string200
The width of the gradient on either side
Events
Event NameDescriptionfinish
Emitted when the marquee finishes scrolling and stops. Only calls if loop is non-zero.cycleComplete
Emitted when the marquee finishes a loop. Does not call if maximum loops are reached (use onFinish instead).