Fine-tune Icons
This help article shows how to modify the position, size and color of icons in RadToggleButton.
Fine-tune Position
You can change the position of font or image icons to match your concrete requirements. To do this, use the Icon.Top
and Icon.Left
properties to directly offset the icon in the particular toggle state (Example 1).
<telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="Fine Tune Icon Position" Height="40px">
<ToggleStates>
<telerik:ButtonToggleState>
<Icon CssClass="rbRefresh" Top="10px" Left="7px" />
</telerik:ButtonToggleState>
<telerik:ButtonToggleState>
<Icon CssClass="rbSave" Top="10px" Left="7px" />
</telerik:ButtonToggleState>
</ToggleStates>
</telerik:RadToggleButton>
Configure Font-size and Color
The embedded RadToggleButton icons are font icons. Using a font facilitates the customization of the icons. For example, you can change the icon's color and font size with a single line of CSS (see Figure 2 and Example 2).
<style type="text/css">
button.RadButton.customizeIcon .rbPrimaryIcon:before {
color: red;
font-size: 17px;
}
</style>
<telerik:RadToggleButton ID="RadToggleButton2" runat="server" Text="Icon Custom Size and Color" CssClass="customizeIcon">
<ToggleStates>
<telerik:ButtonToggleState>
<Icon CssClass="rbSave" />
</telerik:ButtonToggleState>
<telerik:ButtonToggleState>
<Icon CssClass="rbRefresh" />
</telerik:ButtonToggleState>
</ToggleStates>
</telerik:RadToggleButton>
This also applies for custom font icons.