Search results

Accessibility

The Slider is characterized with complete ARIA Accessibility support that helps to access by on-screen readers and other assistive technology devices. This component is designed with the reference of guidelines document given in the WAI ARAI Accessibility Practices.

The Slider component uses the Slider role and the following ARIA properties for its element based on the state.

Property Functionalities
aria-valuenow It Indicates the current value of the slider.
aria-valuetext Returns the current text of the slider.
aria-valuemin It Indicates the Minimum value of the slider.
aria-valuemax It Indicates the Maximum value of the slider.
aria-orientation It Indicates the Slider Orientation.
aria-label Slider left and right button label text (increment and decrement).
aria-labelledby It indicates the name of the Slider.

Keyboard interaction

The Keyboard interaction of the Slider component is designed based on the WAI-ARIA Practices described for Slider. Users can use the following shortcut keys to interact with the Slider.

Keyboard shortcuts Actions
Right Arrow   |   Up Arrow Increase the Slider value.
Left Arrow   |   Down Arrow Decrease the Slider value.
Home Moves to the start value (for Range Slider when the second thumb is focused and the Home key is pressed, it moves to the first thumb value).
End Moves to the end value (for Range Slider when the first thumb is focused and the End key is pressed, it moves to the second thumb value).
Page Up Increases the Slider by `largeStep` value.
Page Down Decreases the Slider by `largeStep` value.
Source
Preview
app.component.ts
app.module.ts
main.ts
template.html
index.css
import { Component } from '@angular/core';

@Component({
    selector: 'my-app',
    templateUrl: 'app/template.html',
    styleUrls:['index.css']
})

export class AppComponent {
    public tooltipData01: Object = { placement: 'Before', isVisible: true, showOn: 'Always' };
    public ticksData01: Object = { placement: 'After', largeStep: 20, smallStep: 10, showSmallTicks: true };
    public mintype: string = 'MinRange';

    public tooltipData02: Object = { placement: 'Before', isVisible: true, showOn: 'Always' };
    public ticksData02: Object = { placement: 'After', largeStep: 1 };

    tooltipChangeHandler(args: SliderTooltipEventArgs): void {
        // Weekdays Array
        let daysArr: string [] = ['Sunday','Monday','Tuesday','Wednesday','Thrusday','Friday','Saturday'];
        // Customizing each ticks text into weeksdays
        args.text = daysArr[parseFloat(args.text)];
    }

    renderingTicksHandler(args: SliderTickEventArgs): void {
        // Customizing tooltip to display the Day (in numeric) of the week
        args.text =  'Day ' + (Number(args.text) + 1).toString();
    }
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { SliderModule } from '@syncfusion/ej2-angular-inputs';
/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        SliderModule
    ],
    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);
<div id='container'>
    <div class='wrap'>
        <div class='label'>Slider without formatted values</div>
        <ejs-slider id='slider' [type]="mintype" [min]=0 [max]=100 [value]=30 [step]=10 [tooltip]="tooltipData01" [ticks]="ticksData01"></ejs-slider>
    </div>
    <div class='wrap'>
        <div class='label'>Slider with formatted values</div>
        <ejs-slider id='slider1' [min]=0 [max]=6 [value]=2 [step]=1 [tooltip]="tooltipData02" [ticks]="ticksData02" 
        (tooltipChange)='tooltipChangeHandler($event)' (renderingTicks)='renderingTicksHandler($event)'></ejs-slider>
    </div>
</div>
.wrap {
  box-sizing: border-box;
  height: 100px;
  margin: 0 auto;
  padding: 30px 10px;
  width: 460px;
}

.wrap .label {
  text-align: center;
}