BlazorFastMarquee 1.0.4

dotnet add package BlazorFastMarquee --version 1.0.4
                    
NuGet\Install-Package BlazorFastMarquee -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorFastMarquee" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorFastMarquee" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="BlazorFastMarquee" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlazorFastMarquee --version 1.0.4
                    
#r "nuget: BlazorFastMarquee, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BlazorFastMarquee@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BlazorFastMarquee&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=BlazorFastMarquee&version=1.0.4
                    
Install as a Cake Tool

Blazor Fast Marquee

NuGet

Blazor Fast Marquee is a high-performance marquee component for Blazor inspired by the battle-tested react-fast-marquee library. It delivers the same API surface while embracing .NET's ahead-of-time (AOT) compilation and aggressive trimming so your applications remain lean without sacrificing fidelity.

Why another marquee? Because shipping to WebAssembly or native ahead-of-time targets demands components that are deterministic, trimming safe, and optimized from the first render. Blazor Fast Marquee was built from the ground up with those goals in mind.

Live Demo

🚀 View the interactive demo

Examples

Sample 1

Sample 2

Sample 3

Highlights

  • API parity with React Fast Marquee. Drop-in familiar parameters such as speed, gradientColor, pauseOnHover, and lifecycle callbacks like onCycleComplete.
  • 🖱️ Interactive drag support. Enable drag-to-pan for desktop and mobile with EnableDrag. Automatically respects direction (horizontal for left/right, vertical for up/down).
  • 🪶 Trimming-friendly by design. The library is marked as trimmable, ships without reflection, and has analyzers enabled so you can confidently publish with PublishTrimmed=true.
  • 🚀 AOT ready. RunAOTCompilation is enabled so the component is validated against Native AOT constraints during publish.
  • 🧭 Deterministic layout. A lightweight JavaScript module only measures the rendered width/height and falls back gracefully when observers are unavailable.
  • 🧩 Composable. Works with any child content—text, components, images, or complex layouts.

Getting Started

Installation

Install the package from NuGet:

dotnet add package BlazorFastMarquee

Setup

1. Configure your Blazor app in Program.cs:

For Blazor WebAssembly:

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
// ... rest of your configuration
await builder.Build().RunAsync();

For Blazor Server or Blazor Web App:

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents()
    .AddInteractiveServerComponents()
    .AddInteractiveWebAssemblyComponents(); // If using WebAssembly interactivity

2. CSS and JavaScript are automatically included via Blazor's static web assets system. The component's styles (Marquee.razor.css) and JavaScript module (Marquee.razor.js) are bundled and served automatically—no manual script or link tags required.

3. Import the namespace in your _Imports.razor:

@using BlazorFastMarquee

Usage

Basic example:

@page "/marquee-demo"
@using BlazorFastMarquee

<Marquee Speed="80" Gradient GradientColor="#111827" GradientWidth="128">
    <div class="marquee-chip">🚀 Blazor Fast Marquee</div>
    <div class="marquee-chip">🔥 AOT-ready animations</div>
    <div class="marquee-chip">🧭 Deterministic layout</div>
</Marquee>

With drag support:

<Marquee Speed="50" EnableDrag="true" Direction="MarqueeDirection.Left" Gradient>
    <div class="marquee-chip">🖱️ Drag me!</div>
    <div class="marquee-chip">👆 Click & hold to pan</div>
    <div class="marquee-chip">📱 Touch support included</div>
</Marquee>

Add some styling (optional):

.marquee-chip {
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.12);
}

Production Builds with Trimming & AOT

Blazor Fast Marquee is validated with trimming analyzers and Native AOT so you can ship the smallest possible payloads. When publishing your application run:

 dotnet publish -c Release -p:PublishTrimmed=true -p:TrimMode=link -p:RunAOTCompilation=true

The library opts into invariant globalization to minimize ICU payload size. If your app requires full globalization data, override InvariantGlobalization in your project file.

Props

Parameter Type Default Description
Style string? string.Empty Inline style for the container <div>.
ClassName string? string.Empty Additional CSS class names for the container <div>.
AutoFill bool false Automatically duplicates content to fill unused marquee space.
Play bool true Whether the marquee animation is running.
PauseOnHover bool false Pause the marquee while the pointer hovers over it.
PauseOnClick bool false Pause the marquee when the container is pressed.
EnableDrag bool false Enable drag-to-pan functionality. Users can click/touch and drag to manually pan the marquee (respects direction). Animation pauses during drag.
Direction MarqueeDirection (Left, Right, Up, Down) MarqueeDirection.Left Direction of travel. Vertical marquees rotate content to maintain orientation.
Speed double 50 Speed in pixels per second.
Delay double 0 Delay in seconds before the animation starts.
Loop int 0 Number of times the marquee loops. 0 means infinite.
Gradient bool false Enables a fade gradient overlay at the edges.
GradientColor string "white" Color used by the gradient overlay.
GradientWidth CssLength (double, int, or string) 200 Width of the gradient on both sides.
OnFinish EventCallback default Invoked after the marquee finishes all loops (Loop > 0).
OnCycleComplete EventCallback default Invoked at the end of each animation cycle.
OnMount EventCallback default Invoked once after the marquee has measured its layout.
ChildContent RenderFragment? null The content rendered inside the marquee.

Accessibility & Performance Tips

  • Prefer semantic markup inside ChildContent and provide aria-labels when the marquee conveys essential information.
  • Keep Speed within a comfortable range and consider offering controls to pause for accessibility compliance.
  • Combine marquees with prefers-reduced-motion to disable animations for users who request it.

Testing

The solution includes automated BUnit tests covering layout measurement, callbacks, and attribute forwarding. Run them locally with:

 dotnet test

License

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 447 10/30/2025
1.0.3 178 10/28/2025
1.0.2 172 10/28/2025
1.0.1 181 10/28/2025
1.0.0 174 10/28/2025