Change size in Angular Switch component

27 Apr 20242 minutes to read

The different Switch sizes available are default and small. To reduce the size of default Switch to small, set the cssClass property to e-small.

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




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

@Component({
imports: [
        
        SwitchModule
    ],


standalone: true,
    selector: 'app-root',
    template: `<div class="e-section-control">
                <table class='size'>
                <tr>
                    <td class='lSize'>Small</td>
                    <td>
                        <ejs-switch cssClass="e-small"></ejs-switch>
                    </td>
                </tr>
                <tr>
                    <td class='lSize'>Default</td>
                    <td>
                        <ejs-switch></ejs-switch>
                    </td>
                </tr>
               </table>
               </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));