New to Telerik UI for ASP.NET CoreStart a free 30-day trial

Icon Button

The Button can accommodate an icon which enhances the meaning of the text content.

The Button provides the following methods for configuring icons:

  • Icon()
  • SpriteCssClass()
  • ImageUrl()

Use only one of them with a particular Button instance. If you define multiple properties, only one of them will be obeyed according to the order stated above.

The Icon() method displays the appropriate Kendo UI for jQuery font icon as a content of a <spn> :before pseudo element. The Button enables you to completely omit any text to be specified for its contents.

Razor
	@(Html.Kendo().Button()
		.Name("textButton")
		.Icon("trash")
	)

Alternatively, use the icon-class attribute to set a custom icon. It accepts a CSS class (or multiple space-separated CSS classes).

Razor
	<link href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet" />

	<kendo-button name="buttonCustom" type="button" icon-class="fa fa-magic"></kendo-button>

The SpriteCssClass() method displays the icon as a background of a span element instead.

Razor
	@(Html.Kendo().Button()
		.Name("textButton")
		.Content("Sample Button")
		.SpriteCssClass("myDeleteIcon")
	)

Image icons are applied by using the ImageUrl() method and are displayed as an img element.

Razor
	@(Html.Kendo().Button()
		.Name("textButton")
		.Content("Sample Button")
		.ImageUrl("url/to/myDeleteIcon.png")
	)

See Also

In this article
See Also
Not finding the help you need?
Contact Support