You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+124-3Lines changed: 124 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2328,9 +2328,130 @@ The syntax is similar to the display density descriptor, but instead of display
2328
2328
<b><a href="#">↥ back to top</a></b>
2329
2329
</div>
2330
2330
2331
-
#### Q. ***What is WebP?***
2332
-
#### Q. ***What are Web Components?***
2333
-
#### Q. ***What is accessibility & ARIA role means in a web application?***
2331
+
## Q. ***What is accessibility & ARIA role means in a web application?***
2332
+
2333
+
The Accessible Rich Internet Applications (ARIA) Suite, defines a way to make Web content and Web applications more accessible to people with disabilities. It especially helps with dynamic content and advanced user interface controls developed with HTML, JavaScript, and related technologies.
2334
+
2335
+
Screen readers work with regular HTML, but adding ARIA can provide screen reader users with greater context and interactivity with the content on the page. ARIA has no effect on how elements are displayed or behave in browsers. It does not add new functionality, and is meant to act only as an extra descriptive layer for screen readers.
2336
+
2337
+
Without WAI-ARIA certain functionality used in Web sites is not available to some users with disabilities, especially people who rely on screen readers and people who cannot use a mouse. WAI-ARIA addresses these accessibility challenges, for example, by defining ways for functionality to be provided to assistive technology. With WAI-ARIA, developers can make advanced Web applications accessible and usable to people with disabilities.
2338
+
2339
+
ARIA attributes are divided into two categories: roles, and states & properties.
2340
+
2341
+
### **ARIA Roles**
2342
+
2343
+
An ARIA role is added via a `role="<ROLE TYPE>"` attribute, and does not ever change for an element once it is set. There are four categories of ARIA roles:
2344
+
2345
+
* landmark
2346
+
* document
2347
+
* widget
2348
+
* abstract
2349
+
2350
+
### **Landmark ARIA Roles**
2351
+
2352
+
Much like semantic HTML elements, landmark ARIA Roles are used to give users of assistive technology a better way to navigate and identify the different parts of a web page.
2353
+
2354
+
**Example**
2355
+
2356
+
```html
2357
+
<navclass='mobile-nav'role='navigation'aria-label='Mobile Menu'> List of Links </nav>
2358
+
```
2359
+
2360
+
While seeming redundant, is actually useful for screen readers. It wouldn\'t read the aria-label on this navigation, which is really helpful for giving greater context to visually impaired users, without the `role="navigation"`.
2361
+
2362
+
The different landmark roles you can use are as follows, copied from the W3C Wiki Page:
2363
+
2364
+
***banner**: A region that contains the prime heading or internal title of a page.
2365
+
***complementary**: Any section of the document that supports the main content, yet is separate and meaningful on its own.
2366
+
***contentinfo**: A region that contains information about the parent document such as copyrights and links to privacy statements.
2367
+
***form**: A region of the document that represents a collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing.
2368
+
***main**: Main content in a document. In almost all cases a page will have only one `role=“main”`.
2369
+
***navigation**: A collection of links suitable for use when navigating the document or related documents.
2370
+
***search**: The search tool of a Web document.
2371
+
***application**: A region declared as a web application, as opposed to a web document.
2372
+
2373
+
### **Document ARIA Roles**
2374
+
2375
+
Document roles describe the structure of the content on the page, as opposed to the structure of the whole page, which landmark roles describe. The roles in bold are the ones we think are the most common document aria roles, and the ones which are useful to think about including in your HTML.
2376
+
2377
+
***article**: A section of a page that consists of a composition that forms an independent part of a document, page, or site.
2378
+
***columnheader**
2379
+
***definition**: A definition of a term or concept.
2380
+
***directory**
2381
+
***document**
2382
+
***group**: A set of user interface objects which are not intended to be included in a page summary or table of contents by assistive technologies.
2383
+
***heading**: A heading for a section of the page.
2384
+
***img**
2385
+
***list**
2386
+
***listitem**
2387
+
***math**
2388
+
***note**
2389
+
***presentation**
2390
+
***region**
2391
+
***row**
2392
+
***rowgroup**
2393
+
***rowheader**
2394
+
***separator**
2395
+
***toolbar**
2396
+
2397
+
### **Widget ARIA Roles**
2398
+
2399
+
Widget Roles are used to describe what are often javascript-based interfaces, or the more complicated parts of your web page\'s interface. The roles that are starred are the ones we think are the most common elements widget aria roles, and the ones which are useful useful to think about including in your HTML.
2400
+
2401
+
***alert**: A message with important, and usually time-sensitive, information.
2402
+
***alertdialog**: A type of dialog that contains an alert message, where initial focus goes to an element within the dialog.
2403
+
***button**: An input that allows for user-triggered actions when clicked or pressed.
2404
+
***checkbox**: A checkable input that has three possible values: true, false, or mixed.
2405
+
***dialog**: A dialog is an application window that is designed to interrupt the current processing of an application in order to prompt the user to enter information or require a response.
2406
+
***gridcell**
2407
+
***link**
2408
+
***log**
2409
+
***marquee**
2410
+
***menuitem**
2411
+
***menuitemcheckbox**
2412
+
***menuitemradio**
2413
+
***option**
2414
+
***progressbar**
2415
+
***radio**: A checkable input in a group of radio roles, only one of which can be checked at a time.
2416
+
***scrollbar**
2417
+
***slider**
2418
+
***spinbutton**
2419
+
***status**
2420
+
***tab**: A grouping label providing a mechanism for selecting the tab content that is to be rendered to the user.
2421
+
***tabpanel**: A container for the resources associated with a tab, where each tab is contained in a tablist.
2422
+
***textbox**: Input that allows free-form text as its value.
2423
+
***timer**
2424
+
***tooltip**
2425
+
***treeitem**
2426
+
2427
+
### **Abstract ARIA Roles**
2428
+
2429
+
Abstract aria roles are the basis of how the other ARIA roles are defined. These are not to be used in HTML.
2430
+
2431
+
### **ARIA States & Properties**
2432
+
2433
+
ARIA states and properties are often used to support ARIA roles that exist on a page. ARIA Properties often describe relationships with other elements, and for the most part, do not change once they\'re set.
2434
+
2435
+
ARIA States are more dynamic and are typically updated with JavaScript as a user interacts with a page. Screen readers are notified when these states change, and can announce these changes to users after an interaction takes place.
2436
+
2437
+
While there are 35 aria properties and states the W3C defines and which you can read more about on the W3C site, here are the ones we believe to most commonly used and practical for most web pages/applications.
2438
+
2439
+
***aria-activedescendant**: Identifies the currently active descendant of a composite widget. Use with autofill search suggestions.
2440
+
***aria-autocomplete**: Indicates whether user input completion suggestions are provided. Use with autofill search suggestions.
2441
+
***aria-checked (state)**: Indicates the current “checked” state of checkboxes, radio buttons, and other widgets. You can set this to true, false, or mixed state.
2442
+
***aria-controls**: Identifies the element (or elements) whose contents or presence are controlled by the current element.
2443
+
***aria-describedby**: Identifies the element (or elements) that describes the object.
2444
+
***aria-disabled (state)**: Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
2445
+
***aria-expanded (state)**: Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
2446
+
***aria-hidden (state)**: Indicates that the element and all of its descendants are not visible or perceivable to any user as implemented by the author.
2447
+
***aria-invalid (state)**: Indicates the entered value does not conform to the format expected by the application.
2448
+
***aria-label**: Defines a string value that labels the current element.
2449
+
***aria-labelledby**: Identifies the element (or elements) that labels the current element.
2450
+
***aria-live**: Indicates that an element is dynamic, changing, and will be updated, and describes the types of updates the user can expect from the live region.
2451
+
***aria-owns**: Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
2452
+
***aria-pressed (state)**: Indicates the current “pressed” state of toggle buttons.
2453
+
***aria-required**: Indicates that user input is required on the element before a form may be submitted.
2454
+
***aria-selected (state)**: Indicates the current “selected” state of various widgets.
0 commit comments