Create a block button in Angular Button component
27 Apr 20242 minutes to read
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
.
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">
<!-- 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>
</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));