# Blazor SVG and Font Icons

Telerik UI for Blazor provides a large set of built-in icons. There are two ways to consume and render them: as font icons or as SVG icons. It is also possible to use custom Blazor icons, or define an application-wide setting, which affects the type of icons in all Telerik Blazor components.

The Telerik Blazor components generate the same type of icons (font icons or SVG icons), [depending on the `TelerikRootComponent` configuration](https://www.telerik.com/blazor-ui/documentation/common-features/icons#set-global-blazor-icon-type). However, Telerik UI for Blazor includes standalone [`FontIcon`](https://www.telerik.com/blazor-ui/documentation/common-features/icons#fonticon-component) and [`SvgIcon`](https://www.telerik.com/blazor-ui/documentation/common-features/icons#svgicon-component) components, which can be used at the same time.

In general, font icons produce a smaller HTML footprint and the glyph can be overridden with CSS. SVG icons provide better accessibility and can use multiple colors in a single icon.

This article contains the following sections:

* [How do icons work](https://www.telerik.com/blazor-ui/documentation/common-features/icons#how-blazor-icons-work)
  * [Install icon NuGet packages](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icon-nuget-packages)
  * [Import icon namespaces](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icon-namespaces)
  * [Register font icon stylesheet](https://www.telerik.com/blazor-ui/documentation/common-features/icons#font-icon-stylesheet) (SVG icons don't need it)
* [`FontIcon` component](https://www.telerik.com/blazor-ui/documentation/common-features/icons#fonticon-component)
  * [Set custom font icon size](https://www.telerik.com/blazor-ui/documentation/common-features/icons#set-custom-font-icon-size)
  * [Render font icons with HTML](https://www.telerik.com/blazor-ui/documentation/common-features/icons#render-font-icons-with-html)
* [`SvgIcon` component](https://www.telerik.com/blazor-ui/documentation/common-features/icons#svgicon-component)
  * [Use SVG icon variants](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-svg-icon-variants)
  * [Render custom SVG Icons with HTML](https://www.telerik.com/blazor-ui/documentation/common-features/icons#render-custom-svg-icons-with-html)
  * [Use custom SVG icon collection](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-custom-svg-icon-collection)
* [Set global icon type for the whole application](https://www.telerik.com/blazor-ui/documentation/common-features/icons#set-global-blazor-icon-type)
* [Complete list of built-in icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icons-list)
* [How to use custom icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#custom-blazor-icon-support)
* [Change default icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#change-default-svg-icons)

<CtaPanelIntroduction></CtaPanelIntroduction>

## How Blazor Icons Work

The Telerik Blazor icons have three prerequisites to work:

* [NuGet packages](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icon-nuget-packages)
* [Icon namespaces](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icon-namespaces)
* [Font icon stylesheet](https://www.telerik.com/blazor-ui/documentation/common-features/icons#font-icon-stylesheet) (SVG icons don't need it)

### Icon NuGet Packages

The Telerik Blazor components use built-in icons with the help of two NuGet packages. They are installed **automatically** as dependencies of the `Telerik.UI.for.Blazor` package:

* `Telerik.FontIcons` - defines the `FontIcon` `enum` for easier usage of built-in **font** Blazor icons
* `Telerik.SvgIcons` - defines the `ISvgIcon` interface and the `SvgIcon` static class for built-in **SVG** icons

> tip Unlike the `Telerik.UI.for.Blazor` package, the icon packages are available on the `nuget.org` source. Keep this in mind when using [`packageSourceMapping`](https://www.telerik.com/blazor-ui/documentation/installation/nuget#package-source-mapping).

### Icon Namespaces

To use the icons, import one or both namespaces, for example in `_Imports.razor`:

> caption Register Telerik Blazor icon namespaces

```RAZOR.skip-repl
@using Telerik.FontIcons
@using Telerik.SvgIcons
```

Some components provide icon-related parameters, which can rely on the above packages and namespaces too. For example:

> caption Icon parameter in Telerik Blazor components

```RAZOR.skip-repl
<TelerikButton Icon="@FontIcon.Save">Button with font icon</TelerikButton>

<GridCommandButton Icon="@SvgIcon.Save">Command Button with SVG icon</GridCommandButton>
```

### Font Icon Stylesheet

Register the font icon styles in a similar way as the [component theme](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/overview#using-a-theme).

Note the duplicate At signs `@` in the CDN URL below. This syntax is compatible with `.razor` files. When loading a theme from `index.html`, use just one `@`.

> caption Using the font icon CSS file

```HTML.skip-repl

<link href="_content/Telerik.UI.for.Blazor/css/kendo-font-icons/font-icons.css" rel="stylesheet" />


<link href="https://unpkg.com/@@progress/kendo-font-icons@@latest/dist/index.css" rel="stylesheet" type="text/css" />
```

## FontIcon Component

The `TelerikFontIcon` component can show a [built-in Telerik Blazor font icon](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icons-list) or a custom font icon. Here are the available configuration parameters:

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Parameter    | Type and Default Value            | Description                                                                                                                                                                                                                                                                                                                                                               |
| ------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Flip`       | `IconFlip` `enum` <br /> (`None`) | The icon's flip direction, which allows to mirror (turn over) the image horizontally, vertically, or in both directions.                                                                                                                                                                                                                                                  |
| `Icon`       | `FontIcon` `enum`                 | Any of the [built-in Telerik Blazor font icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icons-list). This parameter takes precedence over `IconClass`, if both are set.                                                                                                                                                                     |
| `IconClass`  | `string`                          | Custom CSS class for a [custom or third-party icon](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-custom-font-icons). Do not use together with the `Icon` parameter.                                                                                                                                                                          |
| `Size`       | `string` <br /> (`"md"`)          | Any of the predefined icon sizes (from `"xs"` to `"xxxl"`). It is possible to set the parameter value to raw strings such as `"lg"`, `"md"`, or `"sm"`. However, the recommended practice is to use the properties of the static [`ThemeConstants.FontIcon.Size` class](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.themeconstants.fonticon.size). |
| `ThemeColor` | `string`                          | Any of the predefined icon colors. Use the static [`ThemeConstants.FontIcon.ThemeColor` class](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.themeconstants.fonticon.themecolor) properties. By default, the icon color will inherit the current CSS text color.                                                                                     |

> caption Using TelerikFontIcon

```RAZOR
<p>
    Font icon with default settings:
    <TelerikFontIcon Icon="@FontIcon.Calculator" />
</p>

<p>
    Large flipped font icon:
    <TelerikFontIcon Icon="@FontIcon.FileAudio"
                     Size="@ThemeConstants.FontIcon.Size.Large"
                     Flip="@IconFlip.Vertical" />
</p>

<p style="color: blue;">
    Font icon that inherits its color:
    <TelerikFontIcon Icon="@FontIcon.Save" />
</p>

<p>
    Font icon with ThemeColor:
    <TelerikFontIcon Icon="@FontIcon.FileAudio"
                     ThemeColor="@ThemeConstants.FontIcon.ThemeColor.Primary" />
</p>

<p>
    Custom (<a href="https://github.com/FortAwesome/Font-Awesome">Font Awesome</a>) font icon:
    <TelerikFontIcon IconClass="fa-regular fa-star" />
    <TelerikButton Icon="@("fa-regular fa-star")">Button with Custom Font Icon</TelerikButton>

    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" />
</p>


<link href="https://unpkg.com/@@progress/kendo-font-icons@@latest/dist/index.css" rel="stylesheet" type="text/css" />
```

### Set Custom Font Icon Size

In addition to the `Size` parameter, you can change the size of the rendered icon with custom CSS and the `font-size` style.

Our font icons are designed on a 16px grid base. For better display quality, use a font size, which is divisible by 16 (32px, 48px and so on).

> caption Increase icon size with CSS

```RAZOR
<style>
    .large-icons .k-icon {
        font-size: 32px;
    }
</style>

<div class="large-icons">
    <TelerikFontIcon Icon="@FontIcon.Filter"></TelerikFontIcon>
</div>

<TelerikFontIcon Icon="@FontIcon.Filter"></TelerikFontIcon>


<link href="https://unpkg.com/@@progress/kendo-font-icons@@latest/dist/index.css" rel="stylesheet" type="text/css" />
```

### Use Custom Font Icons

To show a custom font icon or image icon, use the `IconClass` parameter to set the required CSS class(es). Verify that the classes apply all necessary styles, for example, `display`, `width`, and `height`. Otherwise the rendered `<span>` element may not expand and the icon may not display.

> caption Use custom font icons with the TelerikFontIcon component

```RAZOR
FontAwesome Icon:
<TelerikFontIcon IconClass="fa fa-cog" />

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet" />

<br /><br />

Custom Icon:
<TelerikFontIcon IconClass="custom-icon" />

<style>
    .custom-icon {
        width: 1em;
        height: 1em;
        font-size: 16px;
        line-height: 1;
        display: inline-flex;
        vertical-align: middle;
        /* define a background image or a custom font icon here */
        background: purple;
    }
</style>
```

### Render Font Icons with HTML

Telerik UI for Blazor shares the same [themes](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/overview) with several other Telerik and Kendo UI web component suites. All these products use the same font icons.

You can use the built-in font icons directly with HTML tags, without the `<TelerikFontIcon>` component. Such direct HTML usage may provide more flexibility, but if you don't really need it, we recommend using `FontIcon` objects and the `<TelerikFontIcon>` component instead.

To use the icons directly, refer to <a href="https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/" target="_blank">List of all Telerik Icons</a> and obtain the desired CSS class. The `<TelerikFontIcon>` component simply drops the `k-i-` CSS class prefix to make it easier for you.

> caption Use Telerik font icons with plain HTML

```RAZOR
<span class="k-icon k-font-icon k-i-check k-flip-h k-flip-v"></span>

is the same as

<TelerikFontIcon Icon="@FontIcon.Check" Flip="@IconFlip.Both" />


<link href="https://blazor.cdn.telerik.com/blazor/16.0.0/kendo-font-icons/font-icons.css" rel="stylesheet" />
```

## SvgIcon Component

The `TelerikSvgIcon` component can show a [built-in Telerik Blazor SVG icon](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icons-list) or a [custom SVG icon](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-custom-svg-icon-collection). Here are the available configuration parameters:

| Parameter      | Type and Default Value            | Description                                                                                                                                                                                                                                                                                                                                                             |
| -------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Flip`         | `IconFlip` `enum` <br /> (`None`) | The icon's flip direction, which allows to mirror (turn over) the image horizontally, vertically, or in both directions.                                                                                                                                                                                                                                                |
| `Icon`         | `ISvgIcon`                        | Assign a property of the `SvgIcon` static class to use any of the [built-in Telerik Blazor font icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#icons-list). Alternatively, [implement your own custom SVG Icon class](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-custom-svg-icon-collection).              |
| `Size`         | `string` <br /> (`"md"`)          | Any of the predefined icon sizes (from `"xs"` to `"xxxl"`). It is possible to set the parameter value to raw strings such as `"lg"`, `"md"`, or `"sm"`. However, the recommended practice is to use the properties of the static [`ThemeConstants.SvgIcon.Size` class](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.themeconstants.svgicon.size). |
| `ChildContent` | `RenderFragment`                  | The HTML markup of a custom SVG icon. Do not use together with `Icon`.                                                                                                                                                                                                                                                                                                  |
| `ThemeColor`   | `string`                          | Any of the predefined icon colors. Use the static [`ThemeConstants.SvgIcon.ThemeColor` class](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.themeconstants.svgicon.themecolor) properties.                                                                                                                                                         |
| `Variant`      | `string` <br /> (`outline`)       | The SVG icon variant. Use [`ThemeConstants.SvgIcon.Variant`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.themeconstants.svgicon.variant) constants.                                                                                                                                                                                              |

> caption Using TelerikSvgIcon

```RAZOR
<TelerikSvgIcon Icon="@SvgIcon.Calendar" />

<TelerikSvgIcon Icon="@SvgIcon.FileAudio"
                Size="@ThemeConstants.SvgIcon.Size.Large"
                ThemeColor="@ThemeConstants.SvgIcon.ThemeColor.Primary" />
```

### Use SVG Icon Variants

Starting with version `5.0.0` of the [`Telerik.SvgIcons` package](https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/) the SVG icons support `outline`, `solid`, and `duotone` variants. The default variant is `outline`, which matches the appearance of most SVG icons in previous versions. Use the optional `TelerikSvgIcon` `Variant` parameter.

Components with configurable icons expose a corresponding variant parameter. Use `IconVariant` for a primary icon, an icon-slot-specific parameter such as `RemoveIconVariant` for a named icon, or `IconVariantField` for data-bound items. A missing or unsupported variant renders the default icon content.

```RAZOR
<TelerikSvgIcon Icon="@SvgIcon.Gear"
                Variant="@ThemeConstants.SvgIcon.Variant.Duotone" />

<TelerikButton Icon="@SvgIcon.Gear"
               IconVariant="@ThemeConstants.SvgIcon.Variant.Outline">
    Settings
</TelerikButton>
```

### Set Outline and Duotone Stroke Width

Set the `--kendo-icon-stroke-width` CSS variable to change the stroke width of outline and duotone SVG icons. The default value is `1.5`. The setting does not affect solid icons.

```CSS
:root {
    --kendo-icon-stroke-width: 2;
}
```

The `TelerikSvgIcon` component applies the required variant CSS class automatically. The default outline variant also supports this CSS variable when no `Variant` value is set.

### Render Custom SVG Icons with HTML

The `TelerikSvgIcon` component can accommodate a complete `<svg>` tag as its `ChildContent`. In this way, you have full control over the SVG icon rendering, while using the other component parameters, such as `Flip` or `Size`.

Do not set the `Icon` parameter in this case.

> caption Using custom SVG Icon

```RAZOR
<TelerikSvgIcon Flip="@IconFlip.Horizontal">
    <svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
        <title>moon</title>
        <path d="M8.85028 16.5C11.3178 16.5 13.5715 15.3773 15.0646 13.5378C15.2854 13.2656 15.0446 12.8681 14.7032 12.9331C10.8219 13.6723 7.25756 10.6963 7.25756 6.77825C7.25756 4.52131 8.46575 2.44591 10.4294 1.32844C10.7321 1.15619 10.6559 0.697281 10.312 0.63375C9.82984 0.544842 9.34057 0.500073 8.85028 0.5C4.43437 0.5 0.850281 4.07847 0.850281 8.5C0.850281 12.9159 4.42875 16.5 8.85028 16.5Z" fill="black"></path>
    </svg>
</TelerikSvgIcon>
```

### Use Custom SVG Icon Collection

The `Icon` parameter of `TelerikSvgIcon` expects an `ISvgIcon` object. This is a public interface, together with the `SvgIconBase` class. You can use them to create a collection of custom SVG icons.

The `ISvgIcon` interface members are:

| Member    | Type     | Description                                                                                                             |
| --------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `Name`    | `string` | The identifier of the SVG icon. The component renders it as a `k-svg-i-name` CSS class.                                 |
| `Content` | `string` | All `<path>` tags inside the `<svg>` tag.                                                                               |
| `ViewBox` | `string` | The [`viewBox` attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox) value of the `<svg>` tag. |

> tip You can use a custom SVG icon collection together with the built-in icon rendering feature of all components that have an `Icon` or `IconField` parameter, such as the Button, ContextMenu, Drawer, Menu, PanelBar, TreeView, etc.

> caption Define custom SVG icon collection

```RAZOR
<p>
    Moon:
    <TelerikSvgIcon Icon="@MySvgIcons.Moon" />

    Circles:
    <TelerikSvgIcon Icon="@MySvgIcons.Circles" />
</p>

<TelerikButton Icon="@MySvgIcons.Circles">Button with Custom SVG Icon</TelerikButton>

@code {
    public class Moon : SvgIconBase
    {
        public Moon()
        {
            Name = "moon";
            Content = "<path d=\"M8.85028 16.5C11.3178 16.5 13.5715 15.3773 15.0646 13.5378C15.2854 13.2656 15.0446 12.8681 14.7032 12.9331C10.8219 13.6723 7.25756 10.6963 7.25756 6.77825C7.25756 4.52131 8.46575 2.44591 10.4294 1.32844C10.7321 1.15619 10.6559 0.697281 10.312 0.63375C9.82984 0.544842 9.34057 0.500073 8.85028 0.5C4.43437 0.5 0.850281 4.07847 0.850281 8.5C0.850281 12.9159 4.42875 16.5 8.85028 16.5Z\" fill=\"rgb(31, 31, 31)\" />";
            ViewBox = "0 0 16 17";
        }
    }

    public class Circles : SvgIconBase
    {
        public Circles()
        {
            Name = "circles";
            Content = "<circle cx=\"5\" cy=\"5\" r=\"5\" fill=\"black\" /><circle cx=\"11\" cy=\"11\" r=\"5\" fill=\"red\" />";
            ViewBox = "0 0 16 17";
        }
    }

    public static class MySvgIcons
    {
        public static ISvgIcon Moon => new Moon();

        public static ISvgIcon Circles => new Circles();
    }
}
```

## Set Global Blazor Icon Type

It is possible to configure the icon type for the whole application:

1. Locate the [`<TelerikRootComponent>`](https://www.telerik.com/blazor-ui/documentation/components/rootcomponent/overview) tag in the Blazor app. Normally, it's in a layout file such as `MainLayout.razor` or `TelerikLayout.razor`.
2. Set the RootComponent `IconType` parameter to an [`IconType` enum](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.icontype) value (`Svg` or `Font`). The default icon type is `Svg`.

> caption Define global icon type via TelerikRootComponent

```HTML.skip-repl
<TelerikRootComponent IconType="@IconType.Font">
    @Body
</TelerikRootComponent>
```

> The global `IconType` setting only affects built-in icons that the Telerik components render automatically and the developer cannot change. For example,the sort and filter icons in the Grid header cells, or the open arrow in the DropDownList. The `IconType` parameter does not affect:
>
> * `<TelerikFontIcon>` and `<TelerikSvgIcon>` instances in the app.
> * Icons in Buttons, Menu items, and other navigation components. Such icons are provided by the app and depend on the `Icon` or `IconField` parameters.

## Icons List

The <a href="https://www.telerik.com/design-system/docs/" target="_blank">Progress Design System</a> website provides a list of all <a href="https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/" target="_blank">built-in icons in Telerik UI for Blazor</a>.

> Version 5.0.0 of the Telerik icon packages remove and rename some icons previously available as deprecated font icon aliases. Review the v5.0.0 release notes in the [Icon Packages Changelog](https://www.telerik.com/design-system/docs/foundation/iconography/changelog/).

To define an icon with C# syntax, replace the kebab-case with PascalCase. For example, `qr-code` should become `FontIcon.QrCode` or `SvgIcon.QrCode`.

Each icon box in the icon list is clickable and reveals the following details:

* CSS class aliases, if such exist. Use the CSS classes for [manual HTML rendering of font icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#render-font-icons-with-html). For example, `k-i-plus` is equivalent to `k-i-add`. The C# icon names have no aliases.
* Unicode representation of the font icon glyph. For example, `\e11e` corresponds to the `plus` icon.
* Ability to copy the glyph symbol of the font icon.
* Ability to copy the HTML markup (`<svg>` tag) of the SVG icon.

The built-in SVG icons are exposed to Blazor through `ISvgIcon` objects such as `SvgIcon.Droplet`; their path data is not a separate documented property of the `SvgIcon` class. To use the exact path in custom SVG markup, copy the SVG markup from the icon list. For application-defined icons, use a custom `SvgIconBase` implementation and set its `Content` and `ViewBox` properties.

The icon list may contain icons which are not available in older versions of Telerik UI for Blazor or even in the latest one. Such icons will be added in the next product version.

## Custom Blazor Icon Support

Telerik UI for Blazor supports using custom (third-party) icons:

* [In the `SvgIcon` component](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-custom-svg-icon-collection).
* [In the `FontIcon` component](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-custom-font-icons).
* In [Buttons](https://www.telerik.com/blazor-ui/documentation/components/button/icons), [Menu items](https://www.telerik.com/blazor-ui/documentation/components/menu/icons), [Drawer items](https://www.telerik.com/blazor-ui/documentation/components/drawer/icons) and other [navigation components](https://www.telerik.com/blazor-ui/documentation/introduction#list-of-components).

## Change Default SVG Icons

Use the [`ITelerikIconService`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.services.itelerikiconservice) to replace built-in icons globally across the application. A replacement applies wherever the matching icon renders. Returning `null` keeps the original icon.

1. In `Program.cs`, register your service implementation after `AddTelerikBlazor()`:

> caption Register a custom icon service

```C#
builder.Services.AddTelerikBlazor();
builder.Services.AddSingleton<ITelerikIconService, MyIconService>();
```

2. Implement the [`ReplaceIcon`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.services.itelerikiconservice) method. It receives an `IconInfo` object. Use `IconInfo.IconName` to identify the icon and compare it with `nameof(SvgIcon.X)` or `nameof(FontIcon.X)`. The method returns `object`, so the replacement can be:

* A built-in Telerik SVG icon (a property of the `SvgIcon` static class).
* A built-in Telerik font icon (a `FontIcon` enum value).
* A custom SVG icon that derives from `SvgIconBase`.
* A CSS class string for a custom font icon, such as Font Awesome.

> caption Custom icon service implementation

```C#
using Telerik.Blazor.Services;
using Telerik.SvgIcons;
using Telerik.FontIcons;

public class MyIconService : ITelerikIconService
{
    public object ReplaceIcon(IconInfo iconInfo)
    {
        // Replace with another built-in Telerik SVG icon
        if (iconInfo.IconName == nameof(SvgIcon.Filter))
            return SvgIcon.Plane;

        // Replace a font icon with another built-in Telerik font icon
        if (iconInfo.IconName == nameof(FontIcon.Save))
            return FontIcon.Plane;

        // Replace with a custom SVG icon (see the MoonIcon example below)
        if (iconInfo.IconName == nameof(SvgIcon.Download))
            return new MoonIcon();

        // Replace with a CSS class string (for example, Font Awesome)
        if (iconInfo.IconName == nameof(SvgIcon.Upload))
            return "fa fa-upload";

        // Return null to keep the original icon unchanged
        return null;
    }
}
```

To use a CSS class string replacement, include the respective stylesheet that contains the font icons in your app:

> caption Font Awesome stylesheet reference

```HTML
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet" />
```

To use a custom SVG icon, define a class that derives from `SvgIconBase`:

```C#
using Telerik.SvgIcons;

public sealed class MoonIcon : SvgIconBase
{
    public MoonIcon()
    {
        Name = "moon";
        Content = "<path d=\"M8.85 16.5C4.43 16.5.85 12.92.85 8.5S4.43.5 8.85.5c.49 0 " +
                  ".98.04 1.46.13-1.96 1.12-3.17 3.2-3.17 5.45 0 3.92 3.56 6.9 7.45 " +
                  "6.15-1.49 2.81-4.35 4.27-5.74 4.27Z\" />";
        ViewBox = "0 0 16 17";
    }
}
```

## See Also

* [Built-in Icon List](https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/)
* [Blazor SVGIcon Demos](https://demos.telerik.com/blazor-ui/svgicon/overview)
* [Blazor FontIcon Demos](https://demos.telerik.com/blazor-ui/fonticon/overview)
* [CSS Themes](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/overview)
* [Use Legacy v4 SVG Icons with New Telerik UI for Blazor Versions](https://www.telerik.com/blazor-ui/documentation/knowledge-base/icons-use-legacy-v4-svg-icons-with-new-telerik-ui-for-blazor-versions)
