Width of the DropDownButton can be customized by setting required width to the dropdown element.
The following UI can be achieved by setting
iconPosition
as Top
, width as 85px
and size of the font icon as 40px
by adding e-custom
class.
import { Component } from '@angular/core';
import { ItemModel } from '@syncfusion/ej2-angular-splitbuttons';
@Component({
selector: 'app-root',
template: `<!-- To render DropDownButton. -->
<button ejs-dropdownbutton [items]='items' content='Find & Select' iconCss='e-icons e-search' iconPosition='Top' cssClass='e-custom'></button>`
})
export class AppComponent {
// Initialize action items.
public items: ItemModel[] = [
{
text: 'Find'
},
{
text: 'Replace'
},
{
text: 'Go To'
},
{
text: 'Go To Special'
}];
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { DropDownButtonModule } from '@syncfusion/ej2-angular-splitbuttons';
import { AppComponent } from './app.component';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
/**
* Module
*/
@NgModule({
imports: [
BrowserModule,
DropDownButtonModule
],
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);
#loader {
color: #008cff;
height: 40px;
width: 30%;
position: absolute;
font-family: 'Helvetica Neue','calibiri';
font-size:16px;
top: 45%;
left: 45%;
}
.e-search::before {
content: '\e993';
}
button {
margin: 25px 5px 20px 20px;
}
.e-dropdown-btn.e-custom {
width: 85px;
}
.e-dropdown-btn.e-custom .e-search::before {
font-size: 40px;
}