The web accessibility makes web content and web applications more accessible for people with disabilities. It especially helps in dynamic content change and development of advanced user interface controls with AJAX, HTML, JavaScript, and related technologies.
Switch provides built-in compliance with WAI-ARIA
specifications. WAI-ARIA
support is achieved through the
attributes like aria-checked
and aria-disabled
. It helps the people with disabilities by providing information
about the widget for assistive technology in the screen readers, such as screen readers.
Properties | Functionality |
---|---|
role | Indicates the switch component. |
aria-checked | Indicates whether the input is checked, unchecked. |
aria-disabled | Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. |
Keyboard shortcuts | Actions |
Space | When the switch has focus, pressing the Space key changes the state of the switch. |
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `<table class='size'>
<tr>
<td class='lSize'>Checked</td>
<td>
<ejs-switch [checked]="true"></ejs-switch>
</td>
</tr>
<tr>
<td class='lSize'>Unchecked</td>
<td>
<ejs-switch></ejs-switch>
</td>
</tr>
</table>`
})
export class AppComponent { }
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { SwitchModule } from '@syncfusion/ej2-angular-buttons';
import { AppComponent } from './app.component';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
/**
* Module
*/
@NgModule({
imports: [
BrowserModule,
SwitchModule
],
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);