Customize Button Appearance in Blazor Button Component

26 Dec 20231 minute to read

You can customize the appearance of the Button by using the Cascading Style Sheets (CSS). Define the CSS according to your requirement, and assign the class name to the CssClass property. In the following code snippet, the background color, text color, height, width, and sharp corner of the Button can be customized through the e-custom class for all states (hover, focus, and active).

@using Syncfusion.Blazor.Buttons

<SfButton CssClass="e-custom">CUSTOM</SfButton>

<style>
    .e-custom {
        border-radius: 0;
        height: 30px;
        width: 80px;
    }

    .e-custom, .e-custom:hover, .e-custom:focus, .e-custom:active {
        background-color: #ff6e40;
        color: #fff;
    }
</style>

Customizing Blazor Button Appearance