Back to Devexpress

DxButtonBase.IconCssClass Property

blazor-devexpress-dot-blazor-dot-dxbuttonbase-b5051337.md

latest2.3 KB
Original Source

DxButtonBase.IconCssClass Property

Specifies the icon’s CSS class.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(null)]
[Parameter]
public string IconCssClass { get; set; }

Property Value

TypeDefaultDescription
Stringnull

The icon’s CSS class string.

|

Remarks

To use an icon within a button component, connect an icon library to your project and assign the CSS class of the icon to IconCssClass property. Use the IconPosition property to specify the icon’s position.

DevExpress Blazor components support pre-defined icon sets (such as Iconic or Bootstrap-recommended libraries) and custom icon libraries. Refer to the following topic for additional information: Icons.

razor
<DxButton RenderStyle="ButtonRenderStyle.Dark" 
          Text="Undo" Title="Undo the last action." 
          IconCssClass="undo" />
<DxButton RenderStyle="ButtonRenderStyle.Dark" 
          Text="Redo" 
          Title="Restore the previously undone action." 
          IconCssClass="redo" 
          IconPosition="ButtonIconPosition.AfterText" />
css
.undo {
    width: 16px;
    height: 16px;
    background-image: url("../images/undo.svg");
    margin: 0 8px 0 0;
}
.redo {
    width: 16px;
    height: 16px;
    background-image: url("../images/redo.svg");
    margin: 0 0 0 8px;
}

Leave the Text property empty to show an icon without text.

Run Demo: Button — Icons

See Also

DxButtonBase Class

DxButtonBase Members

DevExpress.Blazor Namespace