Search results

Accessibility in Angular NumericTextBox component

02 Dec 2022 / 2 minutes to read

The NumericTextBox characterized with complete ARIA Accessibility support which helps to accessible by on-screen readers and other assistive technology devices. This component designed with the reference of the guidelines document given in WAI ARAI Accessibility practices.

The NumericTextBox uses the spinbutton role and following ARIA properties to its element based on its state.

Property Functionality
aria-live The aria-live attribute indicates the priority of updates to a live region
aria-valuemin The aria-valuemin property specifies the minimum allowable range of the NumericTextBox.
aria-valuemax The aria-valuemax property specifies the maximum allowable range of the NumericTextBox.
aria-disabled The aria-disabled property indicates disabled state of the NumericTextBox.
aria-readonly The aria-readonly property indicates the read-only state of the NumericTextBox.
aria-valuenow The aria-valuenow property specifies the current value of the NumericTextBox.
aria-invalid The aria-invalid property indicates that the user input is incorrect or not within acceptable ranges.
aria-label The aria-label property indicates a string value that labels the NumericTextBox.

Keyboard interaction

Keyboard interaction of the NumericTextBox component has been designed based on WAI-ARIA Practices described for the NumericTextBox and it is an alternative to mouse actions to interact with the NumericTextBox.

The below table shows shortcut keys and its corresponding usage.

Keyboard shortcuts Actions
Arrow Down Increments the value.
Arrow Up Decrements the value
Copied to clipboard
import { Component } from '@angular/core';

    selector: 'app-root',
    // specifies the template string for the NumericTextBox component
    // sets value to the NumericTextBox
    template: `
            <ejs-numerictextbox value='10'></ejs-numerictextbox>
export class AppComponent {
    constructor() {
Copied to clipboard
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { NumericTextBoxModule } from '@syncfusion/ej2-angular-inputs';
import { FormsModule } from '@angular/forms';
 * Module
    imports: [
    declarations: [AppComponent],
    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';

Copied to clipboard
<!DOCTYPE html>
<html lang="en">

    <title>EJ2 Angular NumericTextBox</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Angular NumericTextBox Component" />
    <meta name="author" content="Syncfusion" />
    <!-- Here we have used CDN links for our preview purpose  -->
    <link href="index.css" rel="stylesheet" />
    <link href="//" rel="stylesheet" />
    <link href="//" rel="stylesheet" />

    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src="systemjs.config.js"></script>

    <div id='ang_container'>
        <div class='wrap'>
                <div id='loader'>LOADING....</div>

Copied to clipboard
#container {
    visibility: hidden;

#loader {
  color: #008cff;
  height: 40px;
  left: 45%;
  position: absolute;
  top: 45%;
  width: 30%;

.wrap {
  margin: 35px auto;
  width: 240px;
  padding-top: 25px;