Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

dimohy/BlazorMaterialIcons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlazorMaterialIcons

latest version preview version downloads

BlazorMaterialIcons is a library that helps you easily use Google's Material Icons in Blazor. You can see a list of all icons in Google's Material Icons

Summary

BlazorMaterialIcons is designed to make it easy to use Material icons in the Blazor. There is also a purpose to see what a simple Blazor library looks like. (My first Blazor library.)

As you can see from the source code, this library is so simple that you can easily understand the Razor or Blazor environment.

Install package

Install BlazorMaterialIcons via NuGet in your project.

dotnet add package BlazorMaterialIcons

Next, add the following to the head tag in wwwroot/index.html for Blazor Webassembly or _Host.cshtml for Blazor Server. BlazorMaterialIcons is needed to access the Material icon in the font provided by Google.

<head>
...
<link href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Sharp|Material+Icons+Round|Material+Icons+Two+Tone" rel="stylesheet">
</head>

Usage

The icon can be displayed via the <MaterialIcon> tag. Specify the icon name with the Kind attribute. Alternatively, you can assign an icon name directly to the contents of the tag. The Google Material icon can display icons with five themes. Themes are accessed via the Theme property. You can resize the icon through the Size property. (Default size is 24px)

Please refer to the following usage

<MaterialIcon Kind="face" />

<MaterialIcon>face</MaterialIcon>

<MaterialIcon Theme="@MaterialIcon.Themes.Filled" Size="12">cast_connected</MaterialIcon>
<MaterialIcon Theme="@MaterialIcon.Themes.Outlined" Size="24">cast_connected</MaterialIcon>
<MaterialIcon Theme="@MaterialIcon.Themes.Rounded" Size="48">cast_connected</MaterialIcon>
<MaterialIcon Theme="@MaterialIcon.Themes.Sharp" Size="64">cast_connected</MaterialIcon>
<MaterialIcon Theme="@MaterialIcon.Themes.TwoTone" Size="128">cast_connected</MaterialIcon>

About

Material Icons for Blazor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published