BlazorStrap
BlazorStrap copied to clipboard
Bootstrap 4 Components for Blazor Framework
trafficstars
BlazorStrap
Bootstrap 4 and Bootstrap 5 Components for Blazor Framework
Install
Bootstrap 5
Important: Target V5 for bootstrap 5
<PackageReference Include="BlazorStrap" Version="5.*.*" />
Bootstrap 5 Components for Blazor Framework
Install
Blazor WebAssembly
- 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.csaddbuilder.Services.AddBlazorStrap();
- In
_Imports.razoradd@using BlazorStrap
Blazor Server (Server-side Blazor)
- 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.csorStartup.csaddServices.AddBlazorStrap();to your build pipeline
- In
_Imports.razoradd@using BlazorStrap
Bootstrap 4
Important: Target V1 for bootstrap 4
<PackageReference Include="BlazorStrap" Version="1.*.*" />
Blazor WebAssembly (Client-side Blazor)
- 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();.
Blazor Server (Server-side Blazor)
- 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();.
Docs
https://blazorstrap.io
BlazorStyled
If you want to manage your styles in code and use dynamic styles you can check out my other project: BlazorStyled
Change Log
https://github.com/chanan/BlazorStrap/releases
Components:
- 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
