The Toolbar component has been designed, keeping in mind the WAI-ARIA specifications,
and applying the WAI-ARIA roles, states, and properties along with keyboard support for people who use assistive devices. WAI-ARIA
accessibility support is achieved through attributes like aria-orientation
, aria-disabled
, and aria-haspopup
. It provides
information about elements in a document for assistive technology. The component implements keyboard navigation support by
following the WAI-ARIA practices, and has been tested in major screen readers.
Toolbar element is assigned with the role of toolbar
.
Property | Functionalities |
---|---|
role=“toolbar” | This attribute added to the ToolBar element describes the actual role of the element. |
aria-orientation | Indicates the ToolBar orientation. Default value is horizontal . |
aria-haspopup | Indicates the popup mode of the Toolbar. Default value is false. When popup mode is enabled, attribute value has to be changed to true . |
aria-disabled | Indicates the disabled state of the ToolBar. |
Keyboard navigation is enabled by default. Possible keys are
Key | Description |
---|---|
Left | Focuses the previous element. |
Right | Focuses the next element. |
Enter | When focused on a ToolBar command, clicking the key triggers the click of Toolbar element. When popup drop-down icon is focused, the popup opens. |
Esc(Escape) | Closes popup. |
Down | Focuses the next popup element. |
Up | Focuses the previous popup element. |
import { ItemDirective, ItemsDirective, ToolbarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from "react";
import * as ReactDOM from "react-dom";
export default class ReactApp extends React.Component {
render() {
return (<ToolbarComponent width="300" overflowMode="Popup">
<ItemsDirective>
<ItemDirective text="Cut" prefixIcon="e-cut-icon" showTextOn="Overflow"/>
<ItemDirective text="Copy" prefixIcon="e-copy-icon" showTextOn="Overflow"/>
<ItemDirective text="Paste" prefixIcon="e-paste-icon" showTextOn="Overflow"/>
<ItemDirective type="Separator"/>
<ItemDirective text="Bold" prefixIcon="e-bold-icon" showTextOn="Overflow"/>
<ItemDirective text="Underline" prefixIcon="e-underline-icon" showTextOn="Overflow"/>
<ItemDirective text="Italic" prefixIcon="e-italic-icon" showTextOn="Overflow"/>
<ItemDirective type="Separator"/>
<ItemDirective text="A-Z Sort" prefixIcon="e-ascending-icon" showTextOn="Overflow"/>
<ItemDirective text="Z-A Sort" prefixIcon="e-descending-icon" showTextOn="Overflow"/>
</ItemsDirective>
</ToolbarComponent>);
}
}
ReactDOM.render(<ReactApp />, document.getElementById("toolbar"));
import { ItemDirective, ItemsDirective, ToolbarComponent } from '@syncfusion/ej2-react-navigations';
import * as React from "react";
import * as ReactDOM from "react-dom";
export default class ReactApp extends React.Component<{}, {}> {
public render() {
return (
<ToolbarComponent width="300" overflowMode="Popup" >
<ItemsDirective>
<ItemDirective text="Cut" prefixIcon="e-cut-icon" showTextOn="Overflow" />
<ItemDirective text="Copy" prefixIcon="e-copy-icon" showTextOn="Overflow" />
<ItemDirective text="Paste" prefixIcon="e-paste-icon" showTextOn="Overflow" />
<ItemDirective type="Separator" />
<ItemDirective text="Bold" prefixIcon="e-bold-icon" showTextOn="Overflow" />
<ItemDirective text="Underline" prefixIcon="e-underline-icon" showTextOn="Overflow" />
<ItemDirective text="Italic" prefixIcon="e-italic-icon" showTextOn="Overflow" />
<ItemDirective type="Separator" />
<ItemDirective text="A-Z Sort" prefixIcon="e-ascending-icon" showTextOn="Overflow" />
<ItemDirective text="Z-A Sort" prefixIcon="e-descending-icon" showTextOn="Overflow" />
</ItemsDirective>
</ToolbarComponent>
);
}
}
ReactDOM.render(<ReactApp />, document.getElementById("toolbar"));
<!DOCTYPE html>
<html lang="en">
<head>
<title>Syncfusion React Toolbar Sample</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Essential JS 2 for React Components" />
<meta name="author" content="Syncfusion" />
<link href="//cdn.syncfusion.com/ej2/material.css" rel="stylesheet" />
<link href="https://ej2.syncfusion.com/angular/demos/src/toolbar/toolbar.component.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
<style>
#loader {
color: #008cff;
height: 40px;
left: 45%;
position: absolute;
top: 45%;
width: 30%;
}
.custom_bold .e-tbar-btn-text {
font-weight: 900;
}
.custom_italic .e-tbar-btn-text {
font-style: italic;
}
.custom_underline .e-tbar-btn-text {
text-decoration: underline red;
}
.e-txt-casing .e-tbar-btn-text {
font-variant: small-caps;
}
.e-tbar-btn .e-icons {
font-family: 'Material_toolbar';
font-size: 16px;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
}
</style>
</head>
<body>
<div id='toolbar'>
<div id='loader'>Loading....</div>
</div>
</body>
</html>