New to Telerik UI for BlazorStart a free 30-day trial

Appearance Settings

You can control the appearance of the buttons in the <TelerikButtonGroup> by setting the following attributes:

You can use all of them together to achieve the desired appearance. This article will explain their effect one by one.

FillMode

The FillMode toggles the background and border of the TelerikButton. You can set the parameter to a member of the Telerik.Blazor.ThemeConstants.Button.FillMode class:

Class membersManual declarations
Solid
default value
solid
Flatflat
Outlineoutline
Linklink
Clearclear

The built-in Fill modes

@* These are all built-in fill modes *@

@{
    var fields = typeof(Telerik.Blazor.ThemeConstants.Button.FillMode)
        .GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
        | System.Reflection.BindingFlags.FlattenHierarchy)
        .Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

    <TelerikButtonGroup>
        @foreach (var field in fields)
        {
            string fillmode = field.GetValue(null).ToString();
            <ButtonGroupButton FillMode="@fillmode">@fillmode</ButtonGroupButton>
        }
    </TelerikButtonGroup>
}

Rounded

The Rounded parameter applies the border-radius CSS rule to the button to achieve curving of the edges. You can set it to a member of the Telerik.Blazor.ThemeConstants.Button.Rounded class:

Class membersManual declarations
Smallsm
Mediummd
Largelg
Fullfull

The built-in values of the Rounded attribute

@* The built-in rounded edges of the button.  *@

@{
    var fields = typeof(Telerik.Blazor.ThemeConstants.Button.Rounded)
        .GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
        | System.Reflection.BindingFlags.FlattenHierarchy)
        .Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

    <TelerikButtonGroup>
        @foreach (var field in fields)
        {
            string rounded = field.GetValue(null).ToString();
            <ButtonGroupButton Rounded="@rounded">@rounded</ButtonGroupButton>
        }
    </TelerikButtonGroup>
}

Size

You can increase or decrease the size of the button by setting the Size parameter to a member of the Telerik.Blazor.ThemeConstants.Button.Size class:

Class membersManual declarations
Smallsm
Mediummd
Largelg

The built-in button sizes

@{
    var fields = typeof(Telerik.Blazor.ThemeConstants.Button.Size)
        .GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
        | System.Reflection.BindingFlags.FlattenHierarchy)
        .Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

    <TelerikButtonGroup>
        @foreach (var field in fields)
        {
            string size = field.GetValue(null).ToString();
            <ButtonGroupButton Size="@size">@size</ButtonGroupButton>
        }
    </TelerikButtonGroup>
}

ThemeColor

The color of the button is controlled through the ThemeColor parameter. You can set it to a member of the Telerik.Blazor.ThemeConstants.Button.ThemeColor class:

Class membersManual declarations
Base
default value
base
Primaryprimary
Secondarysecondary
Tertiarytertiary
Infoinfo
Successsuccess
Warningwarning
Errorerror
Darkdark
Lightlight
Inverseinverse

The built-in ThemeColors

@* The built-in button colors *@

@{
    var fields = typeof(Telerik.Blazor.ThemeConstants.Button.ThemeColor)
        .GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
        | System.Reflection.BindingFlags.FlattenHierarchy)
        .Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

    <TelerikButtonGroup>
        @foreach (var field in fields)
        {
            string themeColor = field.GetValue(null).ToString();
            <ButtonGroupButton ThemeColor="@themeColor">@themeColor</ButtonGroupButton>
        }
    </TelerikButtonGroup>
}

ThemeBuilder

To take full control over the appearance of the Telerik UI for Blazor components, you can create your own styles by using ThemeBuilder.

ThemeBuilder is a web application that enables you to create new themes and customize existing ones. Every change that you make is visualized almost instantly. Once you are done styling the UI components, you can export a ZIP file with the styles for your theme and use them in your Blazor app.