Blazorise Material Usage

Quickly install Blazorise with Material, one of the world's most popular Blazor UI framework.

Since Material CSS is based on a Bootstrap you only need to change the CSS and JS sources. The code in _Imports.razor will stay the same as for the Bootstrap provider.

Install Packages

First step is to install a Material provider for Blazorise:
Install-Package Blazorise.Material
You also need to install the icon package:
Install-Package Blazorise.Icons.Material

Add Material CSS

Material CSS is not available through the CDN so you must download it yourself from djibe web page. After the download is finished you must extract the CSS and JS to the wwwroot folder inside of you Blazor project.
└── wwwroot/
    ├── css/
    └── js/

Add Static Files

The next step is to change your index.html or _Layout.cshtml / _Host.cshtml file and include the CSS and JS source files:
<!-- Material CSS -->
<link href="css/material.min.css" rel="stylesheet">

<!-- Add Material font (Roboto) and Material icon as needed -->
<link href=",300i,400,400i,500,500i,700,700i|Roboto+Mono:300,400,700|Roboto+Slab:300,400,700" rel="stylesheet">
<link href="" rel="stylesheet">

<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
<link href="_content/Blazorise.Material/blazorise.material.css" rel="stylesheet" />
<link href="_content/Blazorise.Icons.Material/blazorise.icons.material.css" rel="stylesheet" />

<!-- Optional JavaScript -->
<!-- These are the standard js dependencies this provider typically dependes upon, but Blazorise deems these as optional as Blazorise Components should work correctly without these  -->
<!-- jQuery first, then Popper.js, then Material JS -->
<script src=""></script>
<script src=""></script>
<script src=""></script>

<!-- Mandatory JavaScript -->
<script src="js/material.min.js"></script>
<script src="_content/Blazorise.Material/blazorise.material.js"></script>

Add Imports

In your main _Imports.razor add:
@using Blazorise

Register Services

Add the following lines to the relevant sections of Program.cs.
using Blazorise;
using Blazorise.Material;
using Blazorise.Icons.Material;

    .AddBlazorise( options =>
        options.Immediate = true;
    } )

PWA & Offline Support (optional)

For information about PWAs & offline support, please take a look at our PWA docs.

On this page