Blazor.GoldenLayout
1.0.1
dotnet add package Blazor.GoldenLayout --version 1.0.1
NuGet\Install-Package Blazor.GoldenLayout -Version 1.0.1
<PackageReference Include="Blazor.GoldenLayout" Version="1.0.1" />
<PackageVersion Include="Blazor.GoldenLayout" Version="1.0.1" />
<PackageReference Include="Blazor.GoldenLayout" />
paket add Blazor.GoldenLayout --version 1.0.1
#r "nuget: Blazor.GoldenLayout, 1.0.1"
#:package Blazor.GoldenLayout@1.0.1
#addin nuget:?package=Blazor.GoldenLayout&version=1.0.1
#tool nuget:?package=Blazor.GoldenLayout&version=1.0.1
👉 查看中文文档
Hi, I'm Ouse. Welcome to this library!
This is a Blazor wrapper for GoldenLayout.js, which helps you create dockable, resizable layouts in your Blazor applications. A huge thanks to the GoldenLayout team for their amazing work! 🙌
✨ Quick Start
1️⃣ Install NuGet Package
Install-Package Blazor.GoldenLayout
2️⃣ Add Theme CSS
Add your preferred theme to index.html (Blazor Wasm) or App.razor (Blazor Web App).
JS files will be injected dynamically.
Example (dark theme):
<link type="text/css" rel="stylesheet" href="_content/Blazor.GoldenLayout/goldenlayout-dark-theme.css" />
3️⃣ Register Components
In Program.cs, register your components like this:
For Blazor WebAssembly:
builder.Services.RegisterGoldenLayoutService(new Dictionary<Type, string>
{
{ typeof(Counter), "Counter"},
{ typeof(HelloWorld), "HelloWorld"},
});
builder.RootComponents.RegisterGoldenLayoutComponent();
For Blazor Server:
builder.Services.RegisterGoldenLayoutService(new Dictionary<Type, string>
{
{ typeof(Counter), "Counter"},
{ typeof(HelloWorld), "HelloWorld"},
});
builder.Services.AddServerSideBlazor(options =>
{
options.RootComponents.RegisterGoldenLayoutComponent();
});
4️⃣ Disable Prerendering (If enabled)
Due to lifecycle differences, prerendering must be disabled for now to avoid duplicate component registration.
<body>
<Routes @rendermode="@(new InteractiveServerRenderMode(prerender: false))" />
<script src="_framework/blazor.web.js"></script>
</body>
🧩 Razor-Based Layout Example
See the Chinese version above for a detailed Razor example.
🔧 C#-Based Layout Configuration
Also see the code example in the Chinese section.
💡 How It Works
This library is built as a Blazor wrapper over GoldenLayout's JavaScript API, but supports declarative Razor syntax to make layout definition more Blazor-friendly.
More technical documentation coming soon!
🔮 Roadmap
- More API coverage
- GitHub Pages + live preview
- Automatic handling of prerendering
- Lazy loading + component registry improvements
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.15)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.15)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.