OS-like multi window system for Blazor applications.
A reusable Razor Class Library providing draggable, resizable, focusable windows — just like a real desktop environment, with zero external dependencies.
- Draggable, resizable, focusable multi-window system
- Modal & overlay support with zero external dependencies
- Built-in theming (light, dark, Windows CE) + full CSS variable customization
- Works with Blazor Server, WebAssembly, and Hybrid
- DeskUI core RCL providing the full windowing system
- DeskUI.DemoRCL reusable demo RCL consumed by the demo apps
- DeskUI.DemoServer Blazor Server demo
- DeskUI.DemoWASM Blazor WebAssembly demo
- Import the namespace in
_Imports.razor
@using DeskUI- Add the window host in your main page (e.g.
Index.razor) ClassicLight is the default theme, but you can specify another one:
<WindowHost Theme="@Themes.ClassicLight" />- Import the theme stylesheet:
<link rel="stylesheet" href="_content/DeskUI/themes.css" />- Register scripts:
<script src="_content/DeskUI/drag.js"/>async Task OpenFirstWindow()
{
await WindowManager.OpenWindowAsync("FirstComponent", builder =>
{
builder.OpenComponent<FirstForm>(0);
builder.CloseComponent();
}, width: 240, height: 320);
}
async Task OpenSecondWindow()
{
await WindowManager.OpenWindowAsync("SecondComponent (Modal)", builder =>
{
builder.OpenComponent<SecondForm>(0);
builder.CloseComponent();
}, width: 550, height: 250, allowClose: false, overlayed: true);
}DeskUI includes a full CSS variable based theming system. You can choose one of the built-in themes or define your own.
Available built-in themes:
- Themes.ClassicLight
- Themes.ClassicDark
- Themes.WindowsCE
You can override any of the theme variables defined in themes.css.
.my-custom-theme {
--win-bg: #fafafa;
--header-bg: #e8e8e8;
--close-color: #444;
/* ...override any variables you want... */
}Then apply it:
<WindowHost Theme="my-custom-theme" />DeskUI is available on NuGet.org
Install via .NET CLI:
dotnet add package DeskUIThis project is licensed under the MIT License – see the LICENSE file for details.
