Search results

Accessibility in Angular ColorPicker component

03 Dec 2021 / 2 minutes to read

ARIA attributes

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. It helps to provide information about the widget for assistive technology to the disabled person in screen reader.

ColorPicker provides built-in compliance with the WAI-ARIA specifications. WAI-ARIA supports is achieved through the attributes like aria-labeland aria-selected applied to the color palette tiles.

To know about the accessibility of SplitButton, refer to the SplitButton Accessibility section.

Properties Functionality
role Specified as gridcell for the tiles in the color palette.
aria-label Holds the color of the tile.
aria-selected Indicates the current selected state of the tile.

Keyboard interaction

To know about the keyboard interaction of SplitButton, refer to the SplitButton Keyboard interaction section.

The following list of keys can be used to interact with the ColorPicker after the popup has opened.

Press To do this
Upper Arrow Moves the handler/tile up from the current position.
Down Arrow Moves the handler/tile down from the current position.
Left Arrow Moves the handler/tile left from the current position.
Right Arrow Moves the handler/tile right from the current position.
Enter Apply the selected color value.
Tab To focus the next focusable element in the ColorPicker popup.
Copied to clipboard
import { Component } from '@angular/core';

    selector: 'app-root',
    template: `<h4>Choose Color</h4>
               <input ejs-colorpicker type="color" id="element" />`

export class AppComponent { }
Copied to clipboard
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { ColorPickerComponent } from '@syncfusion/ej2-angular-inputs';
import { enableRipple } from '@syncfusion/ej2-base';


 * Module
    imports: [
    declarations: [AppComponent, ColorPickerComponent],
    bootstrap: [AppComponent]
export class AppModule { }
Copied to clipboard
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';