Bootstrap 4 and Bootstrap 5 Components for Blazor Framework
Important: Target V5 for bootstrap 5
<PackageReference Include="BlazorStrap" Version="5.*.*" />
Bootstrap 5 Components for Blazor Framework
- Download the V5.0 package from nuget:
- Modify your index.html with the following.
- Inside the
<head>
add<link href="YourAssemblyName.styles.css" rel="stylesheet">
)
- At the end of the
<body>
add<script src="_content/BlazorStrap/popper.min.js"></script>
<script src="_content/BlazorStrap/blazorstrap.js"></script>
- Inside the
- In
Program.cs
addbuilder.Services.AddBlazorStrap();
- In
_Imports.razor
add@using BlazorStrap
- Download the V5.0 package from nuget:
- Modify your _host.cshtml with the following.
- Inside the
<head>
add<link href="YourAssemblyName.styles.css" rel="stylesheet">
- At the end of the
<body>
add<script src="_content/BlazorStrap/popper.min.js"></script>
<script src="_content/BlazorStrap/blazorstrap.js"></script>
- Inside the
- In
Program.cs
orStartup.cs
addServices.AddBlazorStrap();
to your build pipeline
- In
_Imports.razor
add@using BlazorStrap
Important: Target V1 for bootstrap 4
<PackageReference Include="BlazorStrap" Version="1.*.*" />
- Inside the
<head>
element of yourwwwroot/index.html
, add<script src="_content/BlazorStrap/blazorStrap.js"></script><script src="_content/BlazorStrap/popper.min.js"></script>
. - In
Program
, addbuilder.Services.AddBootstrapCss();
.
- Inside the
<head>
element of yourPages/_Host.cshtml
, add<script src="_content/BlazorStrap/blazorStrap.js"></script><script src="_content/BlazorStrap/popper.min.js"></script>
. - In
Startup
, addServices.AddBootstrapCss();
.
If you want to manage your styles in code and use dynamic styles you can check out my other project: BlazorStyled
https://github.com/chanan/BlazorStrap/releases
- Alerts
- Badges
- Breadcrumbs
- Buttons
- ButtonGroups
- Cards
- Carousals
- Collapse
- Dropdowns
- OffCanvas V5
- Images
- Jumbotrons
- Figures
- Forms
- Layout (Container, Row, Col)
- Listgroups
- Navs
- Navbars
- Media
- Modals
- Pagination
- Popover
- Progress
- Tables
- Tabs
- Tooltip