Soenneker.Blazor.Floating.Windows
11.0.568
Prefix Reserved
dotnet add package Soenneker.Blazor.Floating.Windows --version 11.0.568
NuGet\Install-Package Soenneker.Blazor.Floating.Windows -Version 11.0.568
<PackageReference Include="Soenneker.Blazor.Floating.Windows" Version="11.0.568" />
<PackageVersion Include="Soenneker.Blazor.Floating.Windows" Version="11.0.568" />
<PackageReference Include="Soenneker.Blazor.Floating.Windows" />
paket add Soenneker.Blazor.Floating.Windows --version 11.0.568
#r "nuget: Soenneker.Blazor.Floating.Windows, 11.0.568"
#:package Soenneker.Blazor.Floating.Windows@11.0.568
#addin nuget:?package=Soenneker.Blazor.Floating.Windows&version=11.0.568
#tool nuget:?package=Soenneker.Blazor.Floating.Windows&version=11.0.568
Soenneker.Blazor.Floating.Windows
A Blazor component for mouse-draggable, resizable floating panels with programmatic visibility, positioning, sizing, and typed styling.
Installation
dotnet add package Soenneker.Blazor.Floating.Windows
using Soenneker.Blazor.Floating.Windows.Registrars;
builder.Services.AddFloatingWindowAsScoped();
Add the namespaces to _Imports.razor:
@using Soenneker.Blazor.Floating.Windows
@using Soenneker.Blazor.Floating.Windows.Options
Usage
Windows start hidden. Keep a component reference and call Show() from a user action after the component has rendered.
<button type="button" @onclick="Open">Open inspector</button>
<FloatingWindow @ref="_window"
Title="Order inspector"
Options="_options"
OnDragEnd="SavePosition">
<p>Order details go here.</p>
<button type="button" @onclick="Close">Done</button>
</FloatingWindow>
@code {
private FloatingWindow? _window;
private readonly FloatingWindowOptions _options = new()
{
Width = 480,
Height = 320,
AutoSizeToContent = false,
MinWidth = 280,
MinHeight = 180,
CenterOnShow = true,
ConstrainToViewport = true,
StyleOptions = FloatingWindowStyleOptions.DefaultDark
};
private Task Open() => _window!.Show().AsTask();
private Task Close() => _window!.Hide().AsTask();
private async Task SavePosition()
{
(int x, int y) = await _window!.GetPosition();
// Persist x and y if desired.
}
}
Set Width and Height through FloatingWindowOptions. When AutoSizeToContent is true (the default), explicit width and height are ignored. DynamicAutoSizeToContent observes later content-size changes; combine it with RecenterOnResize when the panel should remain centered.
Control methods
await _window!.Show();
await _window.Hide();
await _window.Toggle();
await _window.SetPosition(120, 80);
await _window.SetSize(640, 480);
(int x, int y) = await _window.GetPosition();
FloatingWindowSize size = await _window.GetSize();
Close() currently has the same visibility behavior as Hide(); it does not remove the Razor component. Destroy() releases the JavaScript behavior and is normally handled by component disposal.
Header and styling
Use HeaderContent to replace the title text while retaining the title bar and close button:
<FloatingWindow @ref="_window" StyleOptions="_style">
<HeaderContent>
<strong>Live metrics</strong>
</HeaderContent>
<p>Content</p>
</FloatingWindow>
@code {
private FloatingWindow? _window;
private readonly FloatingWindowStyleOptions _style = new()
{
BackgroundColor = "#111827",
TextColor = "#f9fafb",
TitleBarBackgroundColor = "#1f2937",
TitleBarTextColor = "#f9fafb",
BorderRadius = "10px"
};
}
DefaultLight and DefaultDark return new style instances that can be customized safely. CustomStyles is emitted directly into the element's inline style; only populate it from trusted application configuration.
Behavior notes
- Dragging uses the title bar; hiding the title bar removes the drag handle.
- Resizing uses the window edges and corners. The current implementation uses mouse events, so do not rely on drag/resize as the only path on touch devices.
- Multiple windows move forward in z-order when dragged or resized. Set the initial
ZIndexinFloatingWindowOptions. OnShow,OnHide,OnDragStart, andOnDragEndrun after the corresponding browser-side state change.- Options are applied when the component is initialized. Use
@keyto recreate it when configuration must change at runtime.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Microsoft.AspNetCore.Components.Web (>= 11.0.0-rc.3.26522.148)
- Soenneker.Blazor.Extensions.EventCallback (>= 11.0.474)
- Soenneker.Blazor.Extensions.IJSObjectReferences (>= 11.0.2)
- Soenneker.Blazor.Interops.Floating (>= 11.0.148)
- Soenneker.Lepton.Suite (>= 11.0.136)
- Soenneker.Utils.Json (>= 11.0.2779)
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 |
|---|---|---|
| 11.0.568 | 62 | 11/4/2026 |
| 11.0.567 | 57 | 11/3/2026 |
| 11.0.566 | 50 | 11/3/2026 |
| 11.0.565 | 46 | 11/3/2026 |
| 11.0.564 | 55 | 11/3/2026 |
| 11.0.562 | 51 | 11/3/2026 |
| 11.0.561 | 55 | 11/3/2026 |
| 11.0.560 | 53 | 11/3/2026 |
| 11.0.559 | 52 | 11/3/2026 |
| 11.0.558 | 61 | 11/2/2026 |
| 11.0.557 | 61 | 11/2/2026 |
| 11.0.556 | 58 | 11/2/2026 |
| 11.0.555 | 67 | 11/2/2026 |
| 11.0.554 | 67 | 10/29/2026 |
| 11.0.553 | 65 | 10/29/2026 |
| 11.0.552 | 71 | 10/29/2026 |
| 11.0.551 | 58 | 10/27/2026 |
| 11.0.550 | 70 | 10/26/2026 |
| 11.0.548 | 62 | 10/26/2026 |
| 11.0.547 | 61 | 10/26/2026 |
Updated Multiple NuGet packages