HeimdallFramework.Bootstrap
5.0.0
dotnet add package HeimdallFramework.Bootstrap --version 5.0.0
NuGet\Install-Package HeimdallFramework.Bootstrap -Version 5.0.0
<PackageReference Include="HeimdallFramework.Bootstrap" Version="5.0.0" />
<PackageVersion Include="HeimdallFramework.Bootstrap" Version="5.0.0" />
<PackageReference Include="HeimdallFramework.Bootstrap" />
paket add HeimdallFramework.Bootstrap --version 5.0.0
#r "nuget: HeimdallFramework.Bootstrap, 5.0.0"
#:package HeimdallFramework.Bootstrap@5.0.0
#addin nuget:?package=HeimdallFramework.Bootstrap&version=5.0.0
#tool nuget:?package=HeimdallFramework.Bootstrap&version=5.0.0
HeimdallFramework.Bootstrap
A strongly-typed, server-first Bootstrap helper library for building HTML with Heimdall and ASP.NET Core.
This library provides a typed abstraction over Bootstrap’s class system, eliminating stringly-typed CSS while preserving full control over markup and layout.
Why This Exists
Traditional Bootstrap usage relies heavily on raw string classes:
<div class="row mb-3 mt-3">
This works—but it is:
- error-prone (
mb3vsmb-3) - hard to refactor
- not discoverable
- not composable in a strongly typed system
HeimdallFramework.Bootstrap solves this by providing:
- strongly typed helpers
- IDE autocomplete for Bootstrap classes
- composable UI primitives
- seamless integration with server-rendered HTML
Philosophy
This library follows the same principles as Heimdall:
- HTML-first – no abstraction over structure, only over classes
- Server-driven UI – works naturally with
IHtmlContent - Zero magic – everything maps directly to real Bootstrap classes
- Composable – small primitives, not giant components
This is not a component framework. It is a typed vocabulary for Bootstrap.
Installation
dotnet add package HeimdallFramework.Bootstrap
Usage
Basic Example
FluentHtml.Div(div =>
{
div.Class(
Bootstrap.Layout.Row,
Bootstrap.Spacing.Mb(3),
Bootstrap.Spacing.Mt(3)
);
div.Div(col =>
{
col.Class(Bootstrap.Layout.ColSpan(6, Bootstrap.Breakpoint.Md));
col.P(p =>
{
p.Class(Bootstrap.Typography.Lead)
.Text("Hello from Heimdall");
});
});
});
Buttons
button.Class(
Bootstrap.Btn.Base,
Bootstrap.Btn.Primary
);
Tables
table.Class(
Bootstrap.Table.Base,
Bootstrap.Table.Hover,
Bootstrap.Table.Borderless
);
Forms
input.Class(Bootstrap.Form.Control);
Layout Helpers
Bootstrap.Layout.Row
Bootstrap.Layout.ColSpan(6, Bootstrap.Breakpoint.Md)
Spacing Helpers
Bootstrap.Spacing.Mb(3)
Bootstrap.Spacing.Mt(2)
Bootstrap.Spacing.P(4)
Utility Helpers
Bootstrap.Display.Flex
Bootstrap.Layout.JustifyContentBetween
Bootstrap.Layout.AlignItemsCenter
Design Goals
Strong Typing Without Abstraction Leakage
Every helper maps directly to a real Bootstrap class:
Bootstrap.Spacing.Mb(3) → "mb-3"
No hidden behavior. No transformation layers.
Discoverability
Instead of memorizing class names, use your IDE:
Bootstrap.Spacing.
Bootstrap.Btn.
Bootstrap.Table.
Composition Over Components
This library intentionally avoids large UI components.
Instead of:
- BootstrapCard.Create(...)
You build:
- Div + Class + Structure
This keeps you in control of markup and aligns with Heimdall’s philosophy.
Integration with Heimdall
This library is designed to work seamlessly with:
- FluentHtml
- HeimdallHtml
- Content Actions & Invocations
- SSE-driven UI updates
Example:
FluentHtml.Div(div =>
{
div.Class(Bootstrap.Card.Base, Bootstrap.Spacing.Mb(3));
div.Div(header =>
{
header.Class(Bootstrap.Card.Header)
.Text("Live Data");
});
div.Div(body =>
{
body.Class(Bootstrap.Card.Body)
.Heimdall()
.Sse("metrics-stream", "metrics-body", HeimdallHtml.Swap.Inner);
});
});
What This Library Is NOT
- Not a component framework
- Not a replacement for Bootstrap
- Not a CSS abstraction layer
- Not tied to any frontend framework
Versioning
This package follows semantic versioning:
- Major – breaking changes to class helpers or structure
- Minor – new helpers or Bootstrap coverage
- Patch – fixes and improvements
Roadmap
- Expand Bootstrap coverage
- Add more utility helpers
- Improve documentation examples
- Provide optional higher-level patterns (kept separate from core)
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
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 |
|---|---|---|
| 5.0.0 | 116 | 4/16/2026 |