Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Web docs
Layout

Marquee

Drifts a decorative band of short items with pure CSS and rests as a static line under reduced motion.

Frameworks
Astro · React · Elements · Dioxus
Registry
lumen add Marquee
Interaction
Native markup
01

See it and copy it

Framework example

Choose Astro, React, Elements, or Dioxus to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.

AstroCode target · live preview uses Astro
  • North Studio
  • Harbor Labs
  • Summit Group
  • Juniper Works
View Marquee code

Framework usage

Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React, Elements, and Dioxus use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.
astro
---
import { Badge, Marquee, Stack } from '@santi020k/lumen-astro'
---

<Stack gap="lg">
  <Marquee items={['Build', 'Lead', 'Ship', 'Teach']} outline="alternate" separator="✦" velocity="follow" />
  {/* Illustrative names only. Authored <li> items are exposed once; the loop clone is hidden and inert. */}
  <Marquee fade gap="sm" label="Illustrative partner organizations" pauseLabel="Pause partner names" speed="slow">
    <li><Badge variant="outline">North Studio</Badge></li>
    <li><Badge variant="outline">Harbor Labs</Badge></li>
    <li><Badge variant="outline">Summit Group</Badge></li>
    <li><Badge variant="outline">Juniper Works</Badge></li>
  </Marquee>
</Stack>
Edit Marquee in browser
02

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add Marquee

API reference

Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.

AttributeValuesDefaultDescription
itemsstring[]-Short items rendered twice inside the track for a seamless loop. Blank items are dropped; without items or children nothing renders. Elements reads a JSON string array from items or the items property.
children / default slot<li> elements-Used when items is empty. Rendered once in a visible list and again in an aria-hidden, inert loop clone with id attributes removed. Elements reads its direct children at the first render and wraps non-<li> children in a list item. separator and outline apply to items only.
separatorstring"•"Mark rendered after each item and hidden from assistive technology. Pass an empty string to omit it.
speed"slow" | "normal" | "fast""normal"Maps to --ui-marquee-duration (70s, 40s, 20s). Override the custom property for any other pace.
durationnumber (seconds)-Seconds per complete loop, clamped to 2-600. Overrides speed by setting --ui-marquee-duration inline; invalid values keep the speed preset.
direction"start" | "end" | "up" | "down""start"Drifts toward the inline start or end; RTL documents reverse the physical direction automatically. up and down loop vertically inside --ui-marquee-block-size (16rem).
gap"sm" | "md" | "lg" | "xl"responsive clampSets the space between items from the shared spacing scale. Omit it to keep the responsive default.
fadebooleanfalseMasks both travel edges while motion is allowed. Width follows --ui-marquee-fade-size (3rem).
pauseControlbooleantrueRenders a native checkbox at the inline-end corner that pauses the animation without JavaScript (WCAG 2.2.2). Hidden under reduced motion. Elements uses pause-control="false" to omit it.
pauseLabelstring"Pause animation"Visible label and accessible name of the pause checkbox. Elements uses pause-label.
pauseOnHoverbooleantruePauses the animation on hover and focus-within. Focus inside the loop always pauses it. Elements uses pause-on-hover="false" to disable.
velocity"none" | "boost" | "follow""none"Boost speeds the loop up with window scroll speed (one extra speed per 220 px/s, up to seven times) and eases it back; follow also reverses it while the page scrolls up. Inner scroll containers do not drive it. In Astro it requires <UIPrimitives />, which loads a small controller only for these bands. A paused loop stays paused and reduced motion stays still.
outline"none" | "alternate""none"Renders every second item as brand-stroked outline text; forced colors fall back to a solid CanvasText fill.
decorativebooleantrue for items, false for childrenKeeps the animated items hidden from assistive technology (the pause control stays reachable). Set false to also expose one visually hidden plain list and a named group. With children, true hides the whole track with aria-hidden and inert.
labelstringnoneAccessible group name used only when decorative is false. Required with children, which are not decorative by default.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.

Customize Marquee

Start with semantic theme tokens and a class on the public component. Keep its accessible name, focus treatment, and interaction state intact.

cssScoped theme overrides
.product-marquee {
  --surface: 0 0% 100%;
  --ink: 220 20% 15%;
  --line: 220 15% 82%;
}

Apply product-marquee through Astro's class, React's className, or the custom element's class. Verify foreground and background contrast in both schemes.

HookValuesDefaultContract
class, classNamestring""Merges custom classes with the generated ui-* root classes.

Use the documented hooks above and adapter types when targeting component states. Theme guide · Accessibility verification scope

Keyboard interactions

Keyboard behavior provided by native HTML controls.

KeyAction
TabReaches focusable children in the visible list once, which pauses the loop; the clone is inert. Then reaches the pause control.
SpaceToggles the native pause control.

Web docsFull catalog