BlazorFastMarquee 1.0.0
See the version list below for details.
dotnet add package BlazorFastMarquee --version 1.0.0
NuGet\Install-Package BlazorFastMarquee -Version 1.0.0
<PackageReference Include="BlazorFastMarquee" Version="1.0.0" />
<PackageVersion Include="BlazorFastMarquee" Version="1.0.0" />
<PackageReference Include="BlazorFastMarquee" />
paket add BlazorFastMarquee --version 1.0.0
#r "nuget: BlazorFastMarquee, 1.0.0"
#:package BlazorFastMarquee@1.0.0
#addin nuget:?package=BlazorFastMarquee&version=1.0.0
#tool nuget:?package=BlazorFastMarquee&version=1.0.0
Blazor Fast Marquee
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.
Highlights
- ⚡ API parity with React Fast Marquee. Drop-in familiar parameters such as
speed,gradientColor,pauseOnHover, and lifecycle callbacks likeonCycleComplete. - 🪶 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.
RunAOTCompilationis 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
Install the package from NuGet:
dotnet add package BlazorFastMarquee
Then register the static web assets (for JS and CSS) in your Program.cs when using Blazor WebAssembly or Server:
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
Include the component in your Razor file:
@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>
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. |
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
ChildContentand providearia-labels when the marquee conveys essential information. - Keep
Speedwithin a comfortable range and consider offering controls to pause for accessibility compliance. - Combine marquees with
prefers-reduced-motionto 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 | Versions 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. |
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See https://github.com/Zettersten/BlazorFastMarquee/releases for release notes.