# Button Icons

You can add a [Telerik Font or SVG icon](https://www.telerik.com/blazor-ui/documentation/common-features/icons) to the Button to illustrate its purpose by using the `Icon` and `EndIcon` parameters.

## Icon Parameter

The `Icon` parameter renders a leading icon, before the Button text or content. The parameter is of type `object` and it accepts:

* A property of the static `SvgIcon` class;
* A member of the `FontIcon` enum;
* A `string` that is a CSS class for a custom icon.

For SVG icons, use `IconVariant` to select an available variant. See [SVG icon variants](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-svg-icon-variants).

> Make sure to [register `font-icons.css` if using Telerik font icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#font-icon-stylesheet).

> caption How to use icons in Telerik Button

<demo metaUrl="client/button/icons/" height="250"></demo>

## EndIcon Parameter

The `EndIcon` parameter renders a trailing icon, after the Button text or content. It accepts the same value types as `Icon`:

* A property of the static `SvgIcon` class;
* A member of the `FontIcon` enum;
* A `string` that is a CSS class for a custom icon.

For SVG icons, use `EndIconVariant` to select an available variant for the trailing icon. The `EndIconVariant` parameter is independent from `IconVariant`, which applies only to the leading `Icon`. See [SVG icon variants](https://www.telerik.com/blazor-ui/documentation/common-features/icons#use-svg-icon-variants).

When the Button has both a leading and a trailing icon, it renders them in the following order: `Icon`, Button text or content, `EndIcon`.

> Make sure to [register `font-icons.css` if using Telerik font icons](https://www.telerik.com/blazor-ui/documentation/common-features/icons#font-icon-stylesheet).

> caption How to use a trailing icon in Telerik Button

```RAZOR.skip-repl
<TelerikButton Icon="@SvgIcon.Plus"
               EndIcon="@SvgIcon.CaretAltRight">
    Add Item
</TelerikButton>

<TelerikButton EndIcon="@FontIcon.Download">
    Download
</TelerikButton>
```

## Notes

If you don't add text to the button, the button will center the icon on all sides.

You can also add custom icons and images with additional markup inside the Button content, where the text is.

Images used as icons should generally be small enough to fit in a line of text. The button is an inline element and is not designed for large images. If you want to use big icon buttons, consider one of the following options:

* Define a `Class` on the button that provides `height` and `width`. The width and height can be set in `px` sufficient to accommodate the icon or to `auto`,
* Attach an `@onclick` handler to an icon/`span`/`img` element instead of using a button,
* Add your own HTML inside the button, something like: `<TelerikButton><img style="width: 400px; height: 400px;" src="my-icon.svg" />some text</TelerikButton>`

## See Also

* [Telerik UI for Blazor Button Overview](https://www.telerik.com/blazor-ui/documentation/components/button/overview)
