# BlazorStrap gives Blazor apps Bootstrap components while leaving the CSS to the template

> BlazorStrap packages Bootstrap 4 and Bootstrap 5 components for the Blazor framework as NuGet libraries, split into a core package for logic and JSInterop and separate display packages for the rendered markup. The setup is four edits, but the version pairing between core and display packages is where teams get stuck.

**chanan/BlazorStrap** — Bootstrap 4 Components for Blazor Framework

- Repository: https://github.com/chanan/BlazorStrap
- Website: https://blazorstrap.io
- Stars: 933 · Forks: 160
- Language: HTML
- License: Unlicense
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/chanan-blazorstrap

## Bootstrap markup for Blazor, with the stylesheet left out on purpose

BlazorStrap exists to answer one awkward question: how do you get Bootstrap widgets that behave properly inside a Blazor application. The project's own heading calls it Bootstrap 4/5 components for Blazor, and the package description is Bootstrap 4 Components for Blazor Framework. The interesting decision is what it leaves out. The documentation states plainly that bootstrap.min.css is not included in the package, because it already exists in the blazor wasm and blazor server side templates. That means the library hands you component behaviour and markup while the visual layer comes from the template that already generated your project. You do not end up with two copies of Bootstrap fighting over the same classes, but you also do not get a component set that works without a Bootstrap stylesheet present. The stylesheet references you add in your host page therefore cover the visual layer, loading Bootstrap itself alongside your assembly's styles.

## A core package for logic and display packages for markup

The package layout is the first thing to understand. The documentation separates a Core Package, which handles all the logic and the JSInterop, from the display packages, which render the components. V5 is for Bootstrap 5 and V4 is for Bootstrap 4, so the Bootstrap major version is chosen by picking a different display package rather than by setting a configuration flag. The split has a practical consequence for upgrades: the core package and the display package move independently, which is why the install instructions repeat the same warning in every section. You install two packages, they must be at the same version, and an upgrade means upgrading both. The repository also carries extension packages for FluentValidation and TreeView, listed in the documentation as separate NuGet packages rather than as part of the core. Nothing in the documentation merges them, so a team that only needs the base components is still deciding which extension packages to pull in.

## Adding BlazorStrap to a Blazor WebAssembly application

For a WebAssembly host the setup is four steps. You download the BlazorStrap package and the BlazorStrap.V5 package from NuGet, keeping both at the same version. You then modify index.html, adding the library's own stylesheet and the Bootstrap stylesheet inside the head element, and appending the bundled Popper script at the end of the body element. Third, you register the services in Program.cs. Fourth, you import the namespace in _Imports.razor so the components resolve without a prefix on every tag. The head and body additions look like this:

```html
<link href="YourAssemblyName.styles.css" rel="stylesheet">
<link href="path_to_bootstrap.min.css" rel="stylesheet" integrity="if_needed" />"
<script src="_content/BlazorStrap/popper.min.js"></script>
```

The two link tags belong in the head element of index.html, and the script tag belongs at the end of the body element, where Popper has to be present before Bootstrap components that rely on it are initialised.

## Program.cs and _Imports.razor carry the two lines that matter

The two lines that make the components available are short. In Program.cs for a WebAssembly host you add the extension call to the builder's service collection, and in _Imports.razor you import the namespace for the Bootstrap version you installed. Both are single statements, and both are the only code changes a WebAssembly project needs beyond the host page edits:

```csharp
builder.Services.AddBlazorStrap();
@using BlazorStrap.V5
```

The AddBlazorStrap call is what wires the core package into the application's service collection, and the using directive is what lets a component tag resolve in a Razor file without a namespace prefix.

## The Server-side variant swaps index.html for _host.cshtml

Server-side Blazor follows the same shape with one file renamed. Instead of index.html you edit _host.cshtml, adding the same two stylesheet links inside the head and the Popper script at the end of the body. The service registration also changes shape, because there is no builder variable in the older Startup style, so the documentation shows the call being added to the build pipeline in Program.cs or Startup.cs:

```csharp
Services.AddBlazorStrap();
```

The namespace import stays the same, so a server-side project moves between the two hosts without touching component code. If you host both models in the same repository, the difference between them is one file and one line of service registration, and everything else in the package layout is identical.

## Beta, Preview and date-stamped release channels

The versioning scheme is unusual enough to be worth reading twice, because the suffix tells you how much risk you are taking. A Beta carries minor fixes as letters from a to z, with an example of 5.2.100-Beta1a, and the documentation states it is not recommended for production use. A Preview, written as 5.2.100-Preview1a, should be tested against your requirements before production use. A Release uses a date stamp for the patch level, an example being 5.2.100.60323, and is described as safe for production. The same version numbers appear in the published release history: V5.2.104, 5.2.103.250519 and 5.2.103. The middle number there, 250519, is the date style used for a release build rather than a letter suffix, so the numeric patch segment tells you when the build was cut without needing a separate release date.

## Where BlazorStrap stops and plain Bootstrap markup begins

There are two boundaries worth knowing before you commit. The first is that the library is not a theme. Because bootstrap.min.css is excluded, a project that strips the template's stylesheet gets unstyled components, and there is no alternative stylesheet bundled in the package to fall back on. The second is that the documentation is thin on the component inventory itself. The pages here describe packages, install steps and versioning, but they do not enumerate which components exist in the V4 and V5 display packages, and they do not document upgrade or migration steps between major Bootstrap versions. If you need to know whether a specific widget such as a date picker or a modal behaves the way you expect, the repository does not answer that, and you would be reading the source in src/ or the docs/ folder to find out.

## Licence, repository shape and the pace of commits

The licence field on the repository says Unlicense, which is the public domain dedication style rather than a conventional permissive licence with an attribution clause. The project also publishes a homepage at blazorstrap.io, and the repository itself carries a BlazorStrap.sln, a NuGet.Config, a CONTRIBUTING.md, a docs directory, a localrepo folder and a src directory. The solution file and NuGet.Config suggest local package feeding during development, but the published packages consumers install come from NuGet.org. The last push was on 2026-09-14 and the repository is not archived, so commits are landing more recently than the newest listed release from 2025-06-21, which means development and publishing are not perfectly in step.

## Conclusion

BlazorStrap fits teams that have already committed to Blazor and want Bootstrap behaviour without hand writing interactive markup, and it fits both WebAssembly and Server hosting because the differences are confined to index.html versus _host.cshtml. It does not fit a team that wants a self contained CSS bundle, since the package deliberately omits bootstrap.min.css, and it does not fit a team unwilling to accept a version lock between the core package and the matching display package. Before adopting it, confirm that the BlazorStrap and BlazorStrap.V5 or BlazorStrap.V4 packages are restored at the same version, then check the prerelease you picked, because the Beta and Preview streams are marked as not recommended for production use.

## FAQ

### Does BlazorStrap include bootstrap.min.css?

No. The documentation states that bootstrap.min.css is not included in the package, because it already exists in the blazor wasm and blazor server side templates, so your project must keep the template stylesheet reference.

### Which BlazorStrap package should I install for Bootstrap 5?

You install two packages: the core BlazorStrap package, which handles the logic and JSInterop, and the BlazorStrap.V5 display package, which renders the Bootstrap 5 components. Both packages should be the same version.

### How do I register BlazorStrap in a Blazor Server application?

Add Services.AddBlazorStrap() to your build pipeline in Program.cs or Startup.cs, add the stylesheet links and the Popper script to _host.cshtml, and add @using BlazorStrap.V5 to _Imports.razor.

### What is the difference between the Beta, Preview and Release versions of BlazorStrap?

Beta carries minor fixes as letters and is marked as not recommended for production use. Preview should be tested against your requirements before production use. Release uses a date stamp such as 5.2.100.60323 and is described as safe for production.

### Which .NET versions does BlazorStrap target?

The documentation does not list a target framework requirement. It states only that the core package and the matching display package must be installed at the same version, and the published releases shown are 5.2.x builds.

## Sources

- [chanan/BlazorStrap on GitHub](https://github.com/chanan/BlazorStrap)
- [License: Unlicense](https://github.com/chanan/BlazorStrap/blob/master/LICENSE)
- [Project website](https://blazorstrap.io)
- [README](https://github.com/chanan/BlazorStrap/blob/master/README.md)
- [Releases](https://github.com/chanan/BlazorStrap/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/chanan-blazorstrap
