Wai aria accessibility in React Uploader component
30 Jan 20234 minutes to read
The uploader component characterized with complete ARIA accessibility support that helps to be accessible by on-screen readers and other assistive technology devices.
Keyboard interaction
The following are the standard keys that works on uploader component.
Keyboard shortcuts | Actions |
---|---|
Tab | Move focus to next element. |
Shift + Tab | Move focus to previous element. |
Enter | Triggers corresponding action to button element. |
Esc | Close the file browser dialog alone and cancels the upload on drop the file. |
[Class-component]
import { UploaderComponent } from '@syncfusion/ej2-react-inputs';
import * as React from 'react';
import * as ReactDOM from "react-dom";
export default class App extends React.Component {
path = {
removeUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Remove',
saveUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Save'
};
render() {
return (<UploaderComponent autoUpload={false} asyncSettings={this.path}/>);
}
}
ReactDOM.render(<App />, document.getElementById('fileupload'));
import { UploaderComponent } from '@syncfusion/ej2-react-inputs';
import * as React from 'react';
import * as ReactDOM from "react-dom";
export default class App extends React.Component<{}, {}> {
public path: object = {
removeUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Remove',
saveUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Save'
}
public render() {
return (
<UploaderComponent autoUpload={false} asyncSettings={this.path} />
);
}
}
ReactDOM.render(<App />, document.getElementById('fileupload'));
[Functional-component]
import { UploaderComponent } from '@syncfusion/ej2-react-inputs';
import * as React from 'react';
import * as ReactDOM from "react-dom";
function App() {
const path = {
removeUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Remove',
saveUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Save'
};
return (<UploaderComponent autoUpload={false} asyncSettings={path}/>);
}
ReactDOM.render(<App />, document.getElementById('fileupload'));
import { UploaderComponent } from '@syncfusion/ej2-react-inputs';
import * as React from 'react';
import * as ReactDOM from "react-dom";
function App(){
const path: object = {
removeUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Remove',
saveUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Save'
}
return (
<UploaderComponent autoUpload={false} asyncSettings={path} />
);
}
ReactDOM.render(<App />, document.getElementById('fileupload'));
You can also explore React File Upload feature tour page for its groundbreaking features. You can also explore our React File Upload example to understand how to browse the files which you want to upload to the server.