An open API service indexing awesome lists of open source software.

https://github.com/soenneker/soenneker.blazor.floating.windows

A Blazor UI element for a drag and drop, overlayed window
https://github.com/soenneker/soenneker.blazor.floating.windows

and blazor blazorlibrary csharp dotnet drag draggable drop floating floatingwindow windows

Last synced: 9 days ago
JSON representation

A Blazor UI element for a drag and drop, overlayed window

Awesome Lists containing this project

README

          

[![](https://img.shields.io/nuget/v/soenneker.blazor.floating.windows.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.blazor.floating.windows/)
[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.blazor.floating.windows/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.blazor.floating.windows/actions/workflows/publish-package.yml)
[![](https://img.shields.io/nuget/dt/soenneker.blazor.floating.windows.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.blazor.floating.windows/)
[![](https://img.shields.io/badge/Demo-Live-blueviolet?style=for-the-badge&logo=github)](https://soenneker.github.io/soenneker.blazor.floating.windows/)
[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.blazor.floating.windows/codeql.yml?label=CodeQL&style=for-the-badge)](https://github.com/soenneker/soenneker.blazor.floating.windows/actions/workflows/codeql.yml)

# Logo Soenneker.Blazor.Floating.Windows

> **Modern, customizable floating windows for Blazor**

---

## ? Features

- ?? **Draggable & Resizable** � Move and resize windows with smooth, modern UX
- ?? **Fully Customizable** � Colors, fonts, borders, shadows, and more
- ?? **Custom theming** � Built-in typed support
- ??? **Multiple Windows** � Manage, stack, and focus with z-index
- ?? **Responsive** � Works on desktop and mobile
- ? **Accessible** � ARIA labels, keyboard navigation
- ? **Event Callbacks** � React to show, hide, drag, resize, and more

---

## ?? Installation

```bash
dotnet add package Soenneker.Blazor.Floating.Windows
```

```csharp
// Program.cs
using Soenneker.Blazor.Floating.Windows.Registrars;
builder.Services.AddFloatingWindowAsScoped();
```

```razor
// _Imports.razor
@using Soenneker.Blazor.Floating.Windows
```

---

## ??? Basic Usage

```razor


Hello World!


This is a floating window with your content.


window?.Close()">Close

```

---

## ?? Theming & Styling

**Built-in themes:**
```razor
...
...
...
```

**Custom styling:**
```razor

{
["backdrop-filter"] = "blur(10px)",
["border"] = "2px solid #007bff"
}
}">...
```

---

## ?? Advanced Example

```razor


Advanced Features


This window demonstrates all the available features.



myWindow?.SetPosition(200, 200)">Move to (200,200)
myWindow?.SetSize(600, 500)">Resize to 600x500
myWindow?.BringToFront()">Bring to Front

@code {
private FloatingWindow? myWindow;
private void OnWindowShow() => Console.WriteLine("Window shown!");
private void OnWindowHide() => Console.WriteLine("Window hidden!");
private void OnDragStart() => Console.WriteLine("Dragging started!");
private void OnDragEnd() => Console.WriteLine("Dragging ended!");
}
```

---

## ?? API Overview

### Properties
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `Title` | `string` | `"Window"` | Title bar text |
| `Width` | `int?` | `400` | Initial width (px) |
| `Height` | `int?` | `300` | Initial height (px) |
| `InitialX` | `int?` | `100` | Initial X position |
| `InitialY` | `int?` | `100` | Initial Y position |
| `Draggable` | `bool?` | `true` | Enable dragging |
| `Resizable` | `bool?` | `true` | Enable resizing |
| `ShowCloseButton` | `bool?` | `true` | Show close button |
| `ShowTitleBar` | `bool?` | `true` | Show title bar |
| `StyleOptions` | `FloatingWindowStyleOptions` | `DefaultLight` | Styling config |

### Events
| Event | Description |
|-------|-------------|
| `OnShow` | Window shown |
| `OnHide` | Window hidden |
| `OnDragStart` | Dragging started |
| `OnDragEnd` | Dragging ended |

### Methods
| Method | Description |
|--------|-------------|
| `Show()` | Show window |
| `Hide()` | Hide window |
| `Toggle()` | Toggle visibility |
| `GetPosition()` | Get (x, y) |
| `SetPosition(x, y)` | Set position |
| `GetSize()` | Get (width, height) |
| `SetSize(width, height)` | Set size |
| `BringToFront()` | Bring window to front |