Posts

Showing posts from September, 2023

How to add Bootstrap to a Blazor application

When you create a Blazor server application, Bootstrap is installed in the css folder. However, this is usually an out of date version, and does not include the javascript bundle which is necessary for some components including tabs.  Rename the "bootstrap" folder to "bootstrap-original". Right click the css folder, and select Add, then Client-Side Library. Select "jsdelivr" as the Provider. Type "bootstrap@" in the Library field, then select the version you want. Select Choose specific files. Select these files dist/css/bootstrap.min.css dist/js/bootstrap.bundle.js Click the Install button. Open _Host.cshtml Add the following to the <head> element: <link rel="stylesheet" href="css/bootstrap/dist/css/bootstrap.min.css" /> ...