Icon
An interactive page: C# runs over a Blazor Server connection.
Renders an icon as inline SVG on the server: no font or script to load, works on static pages, and follows the text color and size around it.
Usage
<Icon Name="Lucide.House" />
<Icon Name="Lucide.TriangleAlert" Size="IconSize.Lg" Color="Color.WarningText" Label="Warning" />
<Icon Role="IconRole.Close" />Beside text
Use Icon with a Name such as Lucide.House: it's sized in em and takes the text color, so it matches the text it sits in.
Preview
Home
Settings
Updated 5 minutes ago
Your plan includes AI summaries for every project.
Code
@* Icons are sized in em and painted with currentColor, so inside text they match it. *@
<Stack Gap="3" Grow>
<TextBlock><Icon Name="Lucide.House" /> Home</TextBlock>
<TextBlock Size="TextSize.Lg"><Icon Name="Lucide.Settings" /> Settings</TextBlock>
<TextBlock Size="TextSize.Sm" Color="Color.Muted"><Icon Name="Lucide.Clock" /> Updated 5 minutes ago</TextBlock>
<TextBlock>Your plan includes <Icon Name="Lucide.Sparkles" Color="Color.PrimaryText" /> AI summaries for every project.</TextBlock>
</Stack>Sizes
Use Size to scale an icon relative to the text around it.
Preview
Code
<Row Gap="5" Align="Align.End" Wrap>
foreach (var size in Enum.GetValues<IconSize>())
{
<Stack Gap="1" Align="Align.Center">
<Icon Name="Lucide.Rocket" Size="size" />
<TextBlock As="span" Size="TextSize.Xs" Color="Color.Muted">size</TextBlock>
</Stack>
}
</Row>Color, stroke width and spin
Use Color, StrokeWidth and Spin to style an icon, and Label to name one that stands alone.
Preview
Code
<Row Gap="5" Align="Align.Center" Wrap>
<Icon Name="Lucide.CircleCheck" Size="IconSize.Xl" Color="Color.SuccessText" Label="Done" />
<Icon Name="Lucide.TriangleAlert" Size="IconSize.Xl" Color="Color.WarningText" Label="Warning" />
<Icon Name="Lucide.CircleAlert" Size="IconSize.Xl" Color="Color.DangerText" Label="Error" />
<Icon Name="Lucide.Heart" Size="IconSize.Xl" StrokeWidth="1" />
<Icon Name="Lucide.Heart" Size="IconSize.Xl" StrokeWidth="2.5" />
<Icon Role="IconRole.Loading" Size="IconSize.Xl" Spin Label="Loading" />
</Row>Semantic roles
Use Role to ask for a purpose rather than a drawing, so one icon set can change every icon the library draws.
Preview
Code
@* The library's own components ask for a role, so one IconSet changes every icon they draw. *@
<Grid Columns="new() { Base = 2, Sm = 3, Xl = 4 }" Gap="3" Grow>
foreach (var role in Enum.GetValues<IconRole>())
{
<Row Gap="2" Align="Align.Center">
<Icon Role="role" />
<TextBlock As="span" Size="TextSize.Sm">role</TextBlock>
</Row>
}
</Grid>Brand logos
Use Brands for the logos sites link to most, drawn to match Lucide.
Code
@* Brand logos drawn to match Lucide. Alone, as in an icon-only link, a logo needs a name. *@
<Row Gap="2" Align="Align.Center" Wrap>
<IconButton Icon="Brands.GitHub" Label="GitHub" Href="https://github.com/enabledevmode/izzyblazor" Variant="ButtonVariant.Ghost" Accent="Accent.Neutral" />
<IconButton Icon="Brands.NuGet" Label="NuGet" Href="https://www.nuget.org/packages/IzzyBlazor" Variant="ButtonVariant.Ghost" Accent="Accent.Neutral" />
<IconButton Icon="Brands.YouTube" Label="YouTube" Href="https://www.youtube.com/" Variant="ButtonVariant.Ghost" Accent="Accent.Neutral" />
<IconButton Icon="Brands.Bluesky" Label="Bluesky" Href="https://bsky.app/" Variant="ButtonVariant.Ghost" Accent="Accent.Neutral" />
<IconButton Icon="Brands.Discord" Label="Discord" Href="https://discord.com/" Variant="ButtonVariant.Ghost" Accent="Accent.Neutral" />
<IconButton Icon="Brands.DotNet" Label=".NET" Href="https://dotnet.microsoft.com/" Variant="ButtonVariant.Ghost" Accent="Accent.Neutral" />
</Row>Mode support
| Feature | Off | Static | Live |
|---|---|---|---|
| Everything | Yes | Yes | Yes |
Off: JavaScript disabled. Static: a static SSR page with IzzyBlazor's script. Live: an interactive page (Server, WebAssembly or Auto).
Accessibility
- Without a
Labelit's decorative:aria-hidden="true", which is right when visible text sits next to it. - With a
Labelit'srole="img"named by the label; give one to an icon that stands alone and means something. - It never takes focus. An action shown only as an icon needs a button with a name: use
IconButton. - With reduced motion set,
Spinslows down rather than stops, since the spin says "still working".
Parameters
| Prop | Type | Default |
|---|---|---|
NameThe icon to show, such as Lucide.House. | IconData? | |
RoleA purpose such as IconRole.Close, resolved through the current icon set. | IconRole? | |
SizeSize relative to the surrounding text. | IconSize | IconSize.Md |
ColorColor. | Responsive<Color> | computed |
LabelAccessible name. | string? | |
StrokeWidthOverrides the stroke width of outlined icons (IzzyBlazor draws Lucide at 1.5). | double? | |
SpinRotates continuously, for loading indicators. | bool | false |
Plus 4 common props.
Full APISee also
- IconButton: a square button with a required label.
- Badge: a small label for a status, category or count.
- Image: a lazy image that keeps its space.