Add easy country flags to your blazor project. Inspired by vue-country-flag ❤️
Easy to use for Blazor Server and Blazor WebAssembly
Install nuget
Install-Package Blazor.Flags -Version 1.0.0
Add using to your _Imports.razor file
@using Blazor.Flags
Only on Blazor Server you need to add css to your _Host.cshtml file
<link href="_content/Blazor.Flags/flags.css" rel="stylesheet" />
Use the Country component to show a flag.
<CountryFlag Country="Country.DE" Size="FlagSize.Small"></CountryFlag>
<CountryFlag InputType="InputType.ISOA2" ISOA2="DE" Size="FlagSize.Small"></CountryFlag>
Parameter | Description | Type | Value |
---|---|---|---|
InputType | Input type to show flag | Enum |
ISOA2 or Country |
Country | Definded Country Enum Type | Enum |
Country.DE , Country.US ... |
ISOA2 | ISO-Alpha-2-Code | String |
DE , US , TR ... |
Size | Size of the flag | Enum |
Small , Normal , Large |
IsRounded | Flag with rounded borders | Boolean |
false by default |
HasShadow | Flag with box shadow around | Boolean |
false by default |
Class | Add custom class to flag | String |
null by default |
Style | Add custom style to flag | String |
null by default |