Search results

Create a Block Button in Angular Button component

You can customize a button into a block button that will span the entire width of its parent element. To create a block button, set the cssClass property as e-block.

Source
Preview
app.component.ts
app.module.ts
main.ts
import { Component } from '@angular/core';

@Component({
    selector: 'app-root',
    styleUrls:['styles.css'],
    template:  `<!-- Block button. -->
                <button ejs-button cssClass="e-block">Block Button</button>

                <!-- Primary block button. -->
                <button ejs-button cssClass="e-block e-primary">Block Button</button>

                <!-- Success block button. -->
                <button ejs-button cssClass="e-block e-success">Block Button</button>`
})

export class AppComponent { }
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ButtonModule } from '@syncfusion/ej2-angular-buttons';
import { AppComponent } from './app.component';
import { enableRipple } from '@syncfusion/ej2-base';

enableRipple(true);

/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        ButtonModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);