Layout Grid Examples

Note: This page is not ready for review; it is work in progress. When ready for review, feedback will be welcome in issue 105.

Following are three example implementations of the design pattern for grid that demonstrate how a grid can be used to group a collection of interactive widgets into a single stop in the page tab sequence. In these examples, each widget, such as a link or button, is in a separate cell of the grid, and the user can navigate among them with the arrow keys. While navigating with the arrow keys, widgets receive keyboard focus and can be activated with Space or Enter.

In addition to streamlining keyboard interfaces, these grids also provide the groups of widgets they contain with a logical structure that can be easily understood by screen reader users. Because screen readers present grids using their broadly familiar table constructs, screen reader users can perceive the logical relationships conveyed by the visual arrangement of the widgets in these examples.

However, one of the most important reasons for using a grid widget as a grouping container for other widgets is that grid cells are structures that do not override or suppress the semantics of the elements they contain. That is, a link contained inside of a grid cell is presented to a screen reader as a link whereas a link inside of a menu must be a menuitem and a link inside of a listbox must be an option. These examples are designed to demonstrate some of the wide variety of circumstances, ranging from very simple to moderately complex, where it is advantageous to leverage this important feature of grids.

Examples

Example 1: Simple List of Links

This example presents a list of links titled "Related Documents" in a grid.

In this implementation:

  1. This grid dynamically restructures itself based on screen size. As the grid structure changes, the arrow key behavior adjusts accordingly.
  2. Since all the links are part of a single logical group, repeatedly pressing either the Down Arrow or Right Arrow key will move focus from the first link to the last link, but in different sequences that depend on the visual arrangement.
  3. The Left Arrow and Up Arrow keys reverse Right Arrow and Down Arrow
  4. The Home and End keys will move focus to the first and last links, respectively.
  5. The Page Down and Page Up keys are not supported since scrolling or row skipping functions are not needed with so few rows.
  6. The links can be activated with the keyboard when focused.

Example 2: Pill List For Components Like a List of Message Recipients

Type a string in the "Add Recipient" field and press enter or activate the "Add" button to see how this grid behaves as the number of elements increases.

In this implementation:

  1. As the number of recipients grows, the new elements wrap on to additional lines as needed.
  2. Like in example 1, Keyboard users can navigate through every element from beginning to end with the Right Arrow key and vice versa with the Left Arrow key.
  3. However, since elements are not vertically aligned, Down Arrow moves to the next logical row instead of to the next visual row. In this case, each row has two cells -- one with the recipient name and one with the remove icon (button) for that name.
  4. Since text inputs require arrow keys to operate, the implementation and user experience are simplified by logically placing the input outside the grid. That is, while the input field appears to be part of the structure, it is not a child of the grid element, and thus has its own place in the tab sequence.

Example 3: Scrollable Search Results

This example demonstrates how a grid can make moving through an infinitely large data set as easy and efficient for keyboard users as it is for people using a mouse.

WAI-ARIA Overview Web Accessibility Initiative W3C

World Wide Web Consortium WAI-ARIA, the Accessible Rich Internet Applications Suite, defines a way to make Web content and Web applications more accessible to people with disabilities.

ARIA States and Properties - W3C

World Wide Web Consortium In this document, states and properties are both treated as aria-prefixed markup attributes. However, they are maintained conceptually distinct to clarify subtle ...

Accessible Rich Internet Applications (WAI-ARIA) 1.0 - W3C

World Wide Web Consortium Mar 20, 2014 - This is the WAI-ARIA 1.0 W3C Recommendation from the Protocols & Formats Working Group of the Web Accessibility Initiative. The Working ...

Accessible Rich Internet Applications (ARIA) Working Group - W3C

World Wide Web Consortium The mission of the Accessible Rich Internet Applications Working Group (ARIA WG) is to develop technologies that enhance accessibility of web content for ...

Accessible Rich Internet Applications (WAI-ARIA) 1.1 - W3C

World Wide Web Consortium Jul 21, 2016 - This version of ARIA 1.1 changes the aria-kbdshortcuts property to aria-keyshortcuts , expands roles that can be used in combo boxes, adds a ...

The Roles Model | Accessible Rich Internet Applications (WAI-ARIA) 1.0

World Wide Web Consortium This section defines the WAI-ARIA role taxonomy and describes the characteristics and properties of all roles. A formal RDF / OWL representation of all the ...

WAI-ARIA Authoring Practices 1.1 - W3C

World Wide Web Consortium Mar 17, 2016 - The WAI-ARIA Authoring Practices Guide is intended to provide an understanding of how to use WAI-ARIA to create an accessible Rich Internet ...

ARIA in HTML - W3C

World Wide Web Consortium Oct 5, 2016 - ARIA in HTML is a [ HTML51 ] specification module. Any HTML features, conformance requirements, or terms that this specification module ...

ARIA in HTML - Web Platform Specs

World Wide Web Consortium Jul 24, 2015 - Setting an ARIA role and/or aria-* attribute that matches the default implicit ARIA semantics is unnecessary and is NOT RECOMMENDED as ...

Accessible Rich Internet Applications (ARIA) Working Group - W3C

World Wide Web Consortium Here are answers to some frequently asked questions (FAQ) about WAI-ARIA, the Accessible Rich Internet Applications Suite. When we add significant ...

WAI-ARIA 1.0 User Agent Implementation Guide - W3C

World Wide Web Consortium WAI-ARIA enables rich Internet applications to have the same accessibility features as desktop GUI applications by adding metadata to markup technologies ...

ARIA - HTML5 - W3C on GitHub

World Wide Web Consortium Alertdialog #. aria.alertdialog = role="" alertdialog "" intermixed with an optional aria-expanded element. Application #. aria.application = role="" application ...

WAI-ARIA 1.0 Authoring Practices - W3C

World Wide Web Consortium Abstract. This document provided readers with an understanding of how to use WAI-ARIA [ ARIA ] to create accessible rich internet applications. It described ...

Notes on Using ARIA in HTML - W3C

World Wide Web Consortium May 21, 2015 - This document demonstrates how to use WAI-ARIA in [ HTML51 ], which especially helps with dynamic content and advanced user interface ...

Accessible Rich Internet Applications (WAI-ARIA) Current Status - W3C

World Wide Web Consortium Accessible Rich Internet Applications (WAI-ARIA) 1.0. Accessibility of Web content to people with disabilities requires semantic information about widgets, ...

Accessible Rich Internet Applications (WAI-ARIA) 1.0 - W3C

World Wide Web Consortium Feb 3, 2014 - This version: http://www.w3.org/WAI/PF/aria/; Previous editors' draft: ... This document is part of the WAI-ARIA suite described in the WAI-ARIA ...

Introduction | Accessible Rich Internet Applications (WAI-ARIA) 1.0

World Wide Web Consortium WAI-ARIA is a technical specification that provides a framework to improve the accessibility and interoperability of web content and applications. This document ...

Using WAI-ARIA | Accessible Rich Internet Applications (WAI-ARIA) 1.0

World Wide Web Consortium WAI-ARIA divides the semantics into roles (the type defining a user interface element) and states and properties supported by the roles. Authors need to ...

Using ARIA landmarks to identify regions of a page - WCAG WG - W3C

World Wide Web Consortium Jan 3, 2014 - NVDA 2 supports all landmarks except it will not support navigation to “application”; Window Eyes as of V.7 does not support ARIA landmarks.

In this implementation:

  1. In addition to the navigation keys supported in examples 1 and 2, Page Down and Page Up can scroll the grid.
  2. As navigating up or down scrolls the visible set of rows, the aria-rowindex value of the row containing the focus informs the screen reader of the number of that row within the total set of rows.

Accessibility Features

Please replace this content with a list of accessibility features demonstrated in this implementation, such as the following. If the content will vary significantly for the above implementations, make this a level 4 section inside each of the above level 3 implementation sections.

Keyboard Support

Key Function
key 1 Key 1 action
key 2 Key 2 action
key 3 Key 3 action

ARIA Roles, Properties, and States

Role Property/State Element Usage
role element X
  • Identify element with the role behavior
aria-xxxxx X[role="yyy"] element
  • Purpose of aria properties or aria states within example

Javascript and CSS Source Code

HTML Source Code

Example 1: Simple List of Links

Example 2: Pill List For Components Like a List of Message Recipients

Example 3: Scrollable Search Results