Customize the TextBox background color and text color in Angular
26 Oct 20241 minute to read
You can customize the textbox styles such as background-color, text-color and border-color by overriding its default styles.
To change the styles of the
floating label
, you must override the style to the input element.
import { Component } from '@angular/core';
import { TextBoxModule } from '@syncfusion/ej2-angular-inputs';
@Component({
imports: [
TextBoxModule
],
standalone: true,
selector: 'app-root',
template: `<div class="wrap">
<label> Normal Input </label>
<ejs-textbox placeholder="First Name"> </ejs-textbox>
<label> Floating Input </label>
<ejs-textbox placeholder="Last Name" floatLabelType="Auto"> </ejs-textbox>
</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));