Customize button appearance in Angular Button component

27 Apr 20241 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 cssClassproperty.
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).

import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { enableRipple } from '@syncfusion/ej2-base'



import { Component } from '@angular/core';

@Component({
imports: [
        
        ButtonModule
    ],


standalone: true,
    selector: 'app-root',
    styleUrls: ['./style.css'],
    template:  `<div class="e-section-control">
                <!-- To customize Button appearance. -->
                <!-- Refer the "e-custom" class details in "styles.css"-->
                <button ejs-button cssClass="e-custom">Custom</button></div>`
})

export class AppComponent { }
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));