Skip to content
Navigation Marquee

Marquee

Content that scrolls endlessly; pure CSS, paused on hover and by reduced-motion preferences.

On this page

Examples

Marquee

BlazorTailwindAccessibleThemeableServerWebAssemblyAutoStatic SSR
BlazorTailwindAccessibleThemeableServerWebAssemblyAutoStatic SSR
Razor
<div class="flex w-full flex-col gap-4">
    <KlyMarquee Duration="25" data-testid="marquee">
        @foreach (var name in Names)
        {
            <KlyBadge Label="@name" Variant="KlyVariant.Subtle" />
        }
    </KlyMarquee>
    <KlyMarquee Reverse="true" Duration="40" Overlay="false">
        @foreach (var name in Names)
        {
            <span class="text-sm text-(--klyroo-text-muted)">@name</span>
        }
    </KlyMarquee>
</div>

@code {
    private static readonly string[] Names = ["Blazor", "Tailwind", "Accessible", "Themeable", "Server", "WebAssembly", "Auto", "Static SSR"];
}

API

KlyMarquee

Endless horizontal or vertical scrolling strip of content, in pure CSS. It pauses on hover and stops when the user prefers reduced motion.

Parameters

Name Type Default Description
Class string Classes added to the root element, merged last so they win over the theme.
Duration Double 30 Seconds for one full loop.
Orientation KlyOrientation KlyOrientation.Horizontal Direction of the scrolling: Horizontal or Vertical . Values: Horizontal, Vertical.
Overlay bool true Fades the edges. Vertical marquees need a height from their parent.
PauseOnHover bool true Pauses while hovered or while something inside has focus.
Repeat int 1 Number of aria-hidden copies of the content. One is enough unless the content is narrower than the container.
Reverse bool false Scrolls the other way.
Ui MarqueeUi Per-instance class overrides of the slots of the marquee, see MarqueeUi . They are merged after the theme and the Class parameter wins on the root slot.

Slots

Name Type Description
ChildContent RenderFragment The items to scroll. Avoid ids and focusable elements: the content is repeated.

Ui slots

Ui takes a MarqueeUi with one class string per slot, merged after the theme.

Slot Styles
Root Classes merged into the root slot of KlyMarquee , after the theme and the app configuration.
Group Classes merged into the group slot of KlyMarquee , after the theme and the app configuration.